Access list for filtered items in dataview

I use a DataView to populate the Grid and using filters to interact with visible rows. My problem is that after applying filters, changing rows or changing the number of rows ... how can I access the dataview to iterate over only these visible rows, for example, to perform some calculations?

Since the lines themselves were not published publicly ... and if they were, the line is not always a data element, since it can also refer to a group, right?

Is there an easy way to access these filtered data items?

(I assume that what I am looking for seems to be accessing "var filtersItems = getFilteredAndPagedItems (_items, _filter);")

thanks,

+8
slickgrid
source share
2 answers

Use dataView.getLength () and dataView.getItem (index) to access files with filter / page / grouped. This is the interface that the grid uses to communicate with the data source.

+9
source share

I posted the solution here if you want to take a look at it. Also for those who may be looking for something similar.

Get filtered data from Dataview in Slickgrid

if you want to show the information to be filtered, and that on the current page you can do something like this.

var pagingInfo = dataView.getPagingInfo(); var start = pagingInfo['pageSize'] * (pagingInfo['pageNum']); var filteredAndPagedItems = dataView.getFilteredItems().slice(start,(start + pagingInfo['pageSize'])); console.table(filteredAndPagedItems); 

something along these lines. getFilteredItems is a custom function that I added to dataview.js. See the link for more information.

0
source share

All Articles