Flex – ItemRenderer in DataGrid

I have a data grid with a checkbox item renderer in the cloumn, allowing row selection:

Main application:






</mx:columns>

Item renderer:


<-- RowCheckbox -->



How do I get the handle of the item renderer/checkbox so I can determine which rows to check?

It’s just a suggestion: We encountered a similar problem in the application. Add the “selected” attribute to the entity in the dataprovider to solve it. Then, the selected attribute of the checkBox is bound to the selected attribute of our entity. To know which ones are selected, we just loop through the entities in the data provider instead of the item renderer. After Many different methods, this is indeed the best choice.

If I remember correctly, the problem is that itemrenderers does not remember the selected state correctly, and the data grid when you scroll up and down Completely messed up. The wrong row was selected after scrolling.

Another option is to dispatch an event in the item renderer that bubbles up all the way to the control hosting the data grid. Then you can Listen to these events and update the model to reflect the changes.

I have a data grid with a checkbox item renderer in the cloumn that allows row selection: < p>

Main application:



< br />

</mx:columns >

Item renderer:


<-- RowCheckbox -->



How to get the handle of the item renderer/checkbox so that I can be sure to check Which line?

Just a suggestion: we encountered a similar problem in the application, and we solved it by adding the “selected” attribute to the entity in the dataprovider of the datagrid Then, the selected property of the checkBox is bound to the selected property of our entity. To know which ones are selected, we just loop through the entities in the data provider instead of the item renderer. After many different methods, this is indeed the best choice

If I remember correctly, the problem is that itemrenderers does not remember the selected state correctly, and the data grid is completely messed up when you scroll up and down. The wrong row is selected after scrolling .

Another option is to dispatch an event in the item renderer that bubbles up to the control hosting the data grid. You can then listen to these events and update the model to reflect the changes. < /p>

Leave a Comment

Your email address will not be published.