1 Reply Latest reply on Dec 26, 2009 9:17 AM by Gregory Lafrance

    Problem in accessing the itemRenderer dynamically

    Arunkumar S

      Hi,

       

           In my application i am using two AdvanceddataGrids. i am showing one datagrid at a time based on the user selection. I have provided the buttons to switch between the grids. These two datagrids are getting the data from XML. By default the data will be available for the first datagrid in XML. Once the user selects the second grid, i am using the HTTPService to fetch the data for that particular grid. (This HTTPService will pass this grid's id as QueryString to the same XML page, and the .Net will read these parameters to fetch the required data from the DB and will print the data in the XML format in the same page).

       

           Here, for the first datagrid, i have used the itemRenderer to show some images (in the datagrid) based on the data available in XML. And i have followed the same for the second grid also.

       

           But the probelm is, whenever the application starts runnning (on Creation complete of the application), i am not able to view the images for the first datagrid, since the data for the second datagrid is not available (i have defined the itemRenderer for the second dataGrid based on XML data).

       

           I have stored the itemRenderers for each datagrid as a separate component. Is there any way to add this itemRenderer component during the run time. (While the user clicks the button to view the second datagrid)?

       

           "(Second datagrid's) coloumnid.itemRenderer = mycomponent.mxml"  (I have tried this code to access during selection of second datagrid. But it didn't work).

       

           Could someone help me on this?

        • 1. Re: Problem in accessing the itemRenderer dynamically
          Gregory Lafrance Level 6

          When you say:

           

          But the probelm is, whenever the application starts runnning (on Creation complete of the application), i am not able to view the images for the first datagrid, since the data for the second datagrid is not available (i have defined the itemRenderer for the second dataGrid based on XML data).

           

          I don't understand. Why would the images in the first datagrid not be availabe because the data for the second grid is not available?

           

          If certain data needs to be loaded for creationComplete, then ensure it is loaded.

           

          Perhaps you can clarify these points as your scenario is not clear.