问题描述
我正在使用Kendo数据源向其提供数据的Kendo网格.我使用的过滤器非常复杂,这就是为什么我必须使用parameterMap函数进行一些排序和过滤的原因.发送查询后,查询字符串将由数据源自动准备,并且一切正常.我需要一种方法来为每个读取请求存储此url(至少是查询字符串).有没有办法访问它?
I am using kendo grid to which data is provided by kendo data source. I am using quite a complicated filter and thats why I have to use parameterMap function to do some sorting and filtering. When the query is sent, the query string is automatically prepared by the data source and everything works fine. I need a way to store this url (at least the query string) for every read request. Is there a way to access it?
推荐答案
经过研究,这很容易.在parameterMap函数中返回数据之前,只需使用encodeURIComponent即可:
After some research... that was pretty easy. It is enough to use decodeURIComponent before returning data in the parameterMap function:
parameterMap: function (data, operation) {
...
storeSomewhereTheValueOf(decodeURIComponent($.param(data)));
return data;
}
这篇关于如何获取剑道数据源的查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!