本文介绍了如何以json格式获取KendoGrid的显示数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 kendoGrid ,我想在过滤和排序后得到 JSON 我做到了这一点?



如下所示:

  var grid = $(#grid)。data(kendoGrid); 

alert(grid.dataSource.data.json); //我可以通过grid.dataSource.data来挖掘,我看到一个函数(.json不存在,我把它放在那里,所以你知道我想实现什么)

非常感谢您的帮助!

($#
$ b

  var displayedData = $(#YourGrid)。data()。kendoGrid.dataSource.view() 

然后将其字符串化如下:

  var displayedDataAsJSON = JSON.stringify(displayedData); 

希望这有助于您!


I have a kendoGrid and i would like to get the JSON out of it after filtering and sorting how do I achieve this?

something like the following,

var grid = $("#grid").data("kendoGrid");

alert(grid.dataSource.data.json); // I could dig through grid.dataSource.data and I see a function ( .json doen't exist I put it there so you know what i want to achieve )

Thanks any help is greatly appreciated!

解决方案

I think you're looking for

var displayedData = $("#YourGrid").data().kendoGrid.dataSource.view()

Then stringify it as follows:

var displayedDataAsJSON = JSON.stringify(displayedData);

Hope this helps!

这篇关于如何以json格式获取KendoGrid的显示数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-13 13:21