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

类似于下面的内容,

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相关问答推荐

使用WSO2 JsonTransform Mediator对空值执行JsonExceptionUndeletedOperationException

Postgres Select json数组并重新映射属性名称

Jolt - 如何比较 if else 条件的两个值

如何使用Powershell查找所有包含特定键值对的JSON对象并迭代所有对象?

遍历 JSON,检索父值

jq可以在两个JSON对象列表中依次添加对象吗?

JOLT JSON 将值从一对多转换为一对一

如果有 1 个元素,如何防止 ConvertFrom-Json 折叠嵌套数组

如何从 rails 中的 respond_to 方法生成 json?

如何将任意 json 对象发布到 webapi

IE8 原生 JSON.parse 错误导致堆栈溢出

如何在 django rest 框架中定义列表字段?

使用 jq,将对象数组转换为具有命名键的对象

使用 Python 3 读取 JSON 文件

杰克逊:反序列化 for each 值都具有正确类型的 Map

在 JSON.NET 中序列化派生类时的字段顺序

可以在 SharedPreferences 中保存 JSON 数组吗?

如何将单引号转义成双引号转成单引号

使用新的 Net Core 3.0 Json 时忽略属性

我如何反序列化以杰克逊为单位的时间戳?