var mainGridDataSource = new kendo.data.DataSource({
type: 'aspnetmvc-ajax',
transport: {
read: {
url: "/test",
contentType: "application/json",
type: "POST"
},
parameterMap: function (options, operation) {
return JSON.stringify(options);
}
}
});
Now when entering the page, the data of this URL is requested by default. I want to change the path of the URL after the change() event. What should I do?
I tried the following method, but it didn’t work.
mainGridOptions.dataSource.transport.read({
url: "/test2"
});
为情所困2017-06-26 10:59:03
function getData(opts, callback){
return new kendo.data.DataSource({
type: 'aspnetmvc-ajax',
transport: {
read: opts,
parameterMap: function (options, operation) {
typeof callback == 'function' && callback(options, operation);
}
}
});
}
Write the request into a method, and pass the url and contentType in as attributes of an object. The business processing after the request is successful is also handled with a callback function. Just execute this method after the change event