Kendo UI 读取未从网格获取当前数据
我有一个网格,其中包含 Id 列表,其中一个按钮包含状态(布尔 Y/N), 我通过单击按钮来调用一个函数来获取正在从网格加载数据的所有 N 个 Id。
function getAll(){
var page = $("#grid").data("kendoGrid").dataSource.page();
console.log(page);
var onlyFailedIds = $('#grid').data("kendoGrid").dataSource.read().then(function(){console.log(dataSource.view()[0].items.filter(row=>row.status==='N').map(row=>row.Id) )});
}
问题是,即使我更改网格页面,我总是得到第 1 页的结果。 如何从其他页面获取结果?
I have a grid that contains a list of Id's with a button which contains state (Boolean Y/N) ,
I am calling a function at the click of a button to get all N Id's which is loading data from the grid.
function getAll(){
var page = $("#grid").data("kendoGrid").dataSource.page();
console.log(page);
var onlyFailedIds = $('#grid').data("kendoGrid").dataSource.read().then(function(){console.log(dataSource.view()[0].items.filter(row=>row.status==='N').map(row=>row.Id) )});
}
The problem is that I am always getting results of page 1 even when I change the page of grid.
How do I get results from other pages?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在使用 DataSource 的视图方法。根据文档:
您应该使用 DataSource 的 data 方法。根据文档:
例如:
You are using DataSource's view method. According to the documentation:
You should be using the DataSource's data method. According to the documentation:
For example: