Boris Todorov Boris Todorov - 7 months ago 19
Javascript Question

Kendo Grid updated on change on option tag element

I need to update my Kendo Grid on change event on option element.
I have to element and depending on one or two of them my backend implementation will return different records. But I do not know how to call something like

('myKendoGrid').update('myUrl?zoneId=4')


enter image description here

Answer

You can use ajax to get the data and refresh the grid based on returned results

$('#selectZone').change(function() {

        $.ajax({
            type: 'POST',
            url: 'myUrl',
            dataType: 'json',
            data: { zoneId: id},
            success: function (data) {
                var grid = $('#grid').getKendoGrid();
                grid.dataSource.data(data);
                grid.refresh();
            }
        });

    });
Comments