Reloading / Refreshing Kendo Grid After AJAX

[code language=”javascript”]
$(‘#GridName’).data(‘kendoGrid’).dataSource.read();
$(‘#GridName’).data(‘kendoGrid’).refresh();
[/code]

read will request the server and reload only reload datasource. There will be no changes in the UI. refresh will re-render items in grid from the current datasource. That’s why both are required

http://stackoverflow.com/questions/18399805/reloading-refreshing-kendo-grid

Alternatif kalau ingin mengubah filter ketika me-reload grid:

[code language=”javascript”]
dataSource.query({
page: 1,
pageSize: 10,
filter: { field: "company_id", operator: "eq", value: companyId }
});
[/code]

Parameter page dan pageSize wajib ada, atau akan muncul masalah pada fungsi pagination.

Konfigurasi filter: http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-filter

Chandra Oemaryadi has written 244 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>