is there a way to manipulate(transform) data right after the request to the server or before binding? I need to make request to the server, transform result data and then bind that data to the kendo grid.
Yes, you should use either parse
in the schema
definition or in the dataBound
event.
Example in parse
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: ..
dataType: "json"
}
},
schema: {
parse: function(data) {
// Example adding a new field to the received data
// that computes price as price times quantity.
$.each(data, function(idx, elem) {
elem.price = elem.qty * elem.price;
});
return data;
}
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With