kendo Grid DataSource with OData format = json

不打扰是莪最后的温柔 提交于 2019-12-04 17:11:46
Yaser Moradi

This is because KendoUI still communicates in the OData V2 format and your server is operating with OData V3.

To solve this problem you can use V2 on your server side or refine how the KendoUI transport processes the response by adding the following configuration to the data source object:

            schema: {
                data: function (data) {
                    return data.value;
                },
                total: function (data) {
                    return data['odata.count'];
                }
            },

So kendo grid will understand that total will be at totalCount section of the response instead of "__count"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!