3 Replies Latest reply on Jul 31, 2009 11:44 AM by Gregory Lafrance

    How to get id for embeded checkbox item in advanced data grid

    fratusf

      I have an advanced data grid table that contains a checkbox column amongs other text columns. I want to walk the table looking for a specific row based on the text label of another column and once found then get get a hold of the checkbox object in that row so I can programatically manipulate the state of the checkbox, for example I want to check or uncheck the checkbox.

       

      Is this possible?

       

      Thanks,

       

      FratusF

        • 1. Re: How to get id for embeded checkbox item in advanced data grid
          Gregory Lafrance Level 6

          You should always examine the dataProvider when checking to see if a checkbox in a list based object is checked, because Flex recycles components for efficiency.

           

          When the checkbox gets changed, change the data in the dataprovider, and then check the data in the dataprovider to see if the checkbox is checked.

           

          If your data does not have a field for the checkbox data, you need to add such a field.

           

          If this post answers your question or helps, please mark it as such.

          • 2. Re: How to get id for embeded checkbox item in advanced data grid
            fratusf Level 1

            Outside of the dataprovider, there is no way to get to the checkbox object to manipulate the state of the checkbox? In my case, the datagrid does not have dataprovider item to check the state of the checkbox. So I need to walk thorugh all the objects looking for one with the proper id. The problem I'm faced with is that the order in which I find the checkbox objects in the datagrid is not the same order in which they appear in the dataprovider.

             

            I was hoping that ther is some attribute in the datagrid that can lead me to the checkbox object itself for the particular row so I can manipulate it.

            • 3. Re: How to get id for embeded checkbox item in advanced data grid
              Gregory Lafrance Level 6

              I've always heard components in DataGrids are recycled, so always reference the data provider. May need to change your data structure.

               

              If this post answers your question or helps, please mark it as such.