2 Replies Latest reply on Jun 13, 2010 5:14 AM by jude paul

    Open a popup window by clicking the icon on the datagrid

    jude paul

      I am using PopUpManager class to displayed the popup. While clicking the datagrid popup will display.

      Now i have a change in requirement that i need to open popup window when the user clicks the icon on the datagrid itemrenderer. Expecting valuable response to complete the requirement.

        • 1. Re: Open a popup window by clicking the icon on the datagrid
          David_F57 Level 5

          hi

           

          If you want have an action dependendant on a cell in the grid you can use itemclick rather than doing the operation from renderer.

           

          protected function dataGrid_itemClickHandler(event:ListEvent):void

          {

             if (dg.columns[event.columnIndex].dataField =="whatever the datafieldname is") doPopup();

          }

          <mx:DataGrid x=0" y="0" width="100%" height="100%" id="dg" itemClick="dataGrid_itemClickHandler(event)"/>
          David.

          • 2. Re: Open a popup window by clicking the icon on the datagrid
            jude paul Level 1

            Hi David,

             

            Thanks for the prompt response.

            In our application, while clicking the datagrid column, we have calculate

            some values based on the datagrid and show the results in the another

            datagrid placed below. Also if the user wants some info about the customer

            we have some it in a popup by

             

            private function custPopUp(event:ListEvent):void {

            if(event.columnIndex==3){

                 hiddenActionpopup = "OpenPopUp";     

                 requestPopUp.send();                    

            }else

                 {

                      // when the user clicks the column other than columnIndex 3,

            we      //have show the calculate results in another datagrid.

            }

            Now what we r going to do is, instead of protecting a column, we have an

            icon for customer details, other than that If an user clicks anywhere it

            will show the calculation.

             

            For that, I need to set action for the icon in the itemrenderer.

             

            Thanks in Advance.

             

             

            Jude Paul

             

             

            hi

             

            If you want have an action dependendant on a cell in the grid you can use

            itemclick rather than doing the operation from renderer.

             

            protected function dataGrid_itemClickHandler(event:ListEvent):void

            {

               if (dg.columns[event.columnIndex].dataField =="whatever the datafieldname

            is") doPopup();

            }

             

            <mx:DataGrid x=0" y="0" width="100%" height="100%" id="dg"

            itemClick="dataGrid_itemClickHandler(event)"/>

             

             

            David.