access list of filtered items in dataview

后端 未结 2 1117
渐次进展
渐次进展 2021-02-15 16:06

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..

2条回答
  •  借酒劲吻你
    2021-02-15 16:27

    I posted a solution here if you want to give that a look. Also for those who might be looking for something similar.

    Get Filtered data from Dataview in Slickgrid

    if you want to show the information that's being filtered and whats 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 those lines.the getFilteredItems is a custom function i added to the dataview.js. for more information view the link.

提交回复
热议问题