views:

20

answers:

1

I have a table "template" which is used in various "instances". All instances have checkboxes in the second column (for record-delete).

What would be the most effective way of traversing the table and check if at least one checkbox is selected (to enable a "delete" button)?

Thanks! Maik

A: 

By table, do you mean DataGrid?

You'll need to store the "checked" state of each column in your dataProvider. The DataGrid makes use of renderer recycling, so there is only a record of what is shown on the screen.

If you check something, and then scroll so that something yo checked is off screen; you'll have no record of what was checked.

www.Flextras.com
Currently the column is linked to a datamodel field: editorDataField="cbSelected"My question is, how do i most effectively iterate over the datamodel in an eventlistener? Such as:grid.getDatamodel[now what?]
Maik
Just loop over that like you would look over anything else. for (x = 0; x < dataProvider.length; x++){ do stuff to dataProvider[x] }
www.Flextras.com