访问数据视图中过滤项目的列表
我使用 DataView 来填充网格,并使用过滤器与可见行进行交互。我的问题是应用过滤器后,行更改或行计数更改...我如何访问数据视图以仅迭代那些可见行,例如进行一些计算?
因为行本身没有公开暴露......如果是的话,行并不总是数据元素,因为也可以引用组,对吧?
那么有没有一种简单的方法来访问这些过滤后的数据元素呢?
(我想我正在寻找的是能够访问“var FilteredItems = getFilteredAndPagedItems(_items, _filter);”)
谢谢,
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,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 dataView.getLength() 和 dataView.getItem(index) 访问过滤/分页/分组数据。
这是网格用来与数据源对话的接口。
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.
如果您想看看,我在这里发布了一个解决方案。也适合那些可能正在寻找类似东西的人。
从 Slickgrid 中的 Dataview 获取筛选数据
如果需要, 要显示正在过滤的信息以及当前页面上的内容,您可以执行类似的操作。
getFilteredItems 是我添加到 dataview.js 中的自定义函数。欲了解更多信息,请查看链接。
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.
something along those lines.the getFilteredItems is a custom function i added to the dataview.js. for more information view the link.