KendoUI Network - Change Data After Request

Is there a way to manipulate (convert) the data immediately after a request to the server or before binding? I need to make a request to the server, convert the result data and then bind this data to the kendo grid.

+4
source share
1 answer

Yes, you must use parsein the definition schemaor in dataBound.

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;
        }
    }
});
+12
source

Source: https://habr.com/ru/post/1534400/


All Articles