access list of filtered items in dataview

Marc picture Marc · Mar 10, 2011 · Viewed 7.8k times · Source

I'm using a DataView to populate the Grid, and using filters to interact with the visible rows. My problem is after applying the filters, on rows change, or rows count change... how can I access the dataview to iterate over only those visible rows, to do some calculations for example?

Because rows themselves are not publicly exposed... and if they were, a row is not always a data element, since can also refer to a Group, right?

Is there an easy way to access those filtered data elements then?

(I guess what I'm looking for is something like being able to access "var filteredItems = getFilteredAndPagedItems(_items, _filter);")

thanks,

Answer

Tin picture Tin · Mar 17, 2011

Use dataView.getLength() and dataView.getItem(index) to access filtered/paged/grouped data. This is the interface the grid is using to talk to the data source.