I solved this by removing meshing outside the function. So, at first the grid is displayed without data.
var ds=new kendo.data.DataSource({ transport: { read: "somefile.php", }, schema: { data:"data", model: { id: "id_pf", fields:{ first:{}, second:{} } } }, total: function(response) { return $(response.data).length; }, pageSize: 10 }); $("#grid").kendoGrid({ dataSource: ds, columns: [ { title: "First", field: "first"}, { title: "Second", field: "second"}, ] });
When the link is clicked, the data source is re-read with the updated URL, updated and now displays the necessary data.
$(" .list").live({click:function(){ var id=$(this).attr('id'); var gridUrl = "somefile.php?id="+ id; var grid = $("#grid").data("kendoGrid"); grid.dataSource.transport.options.read.url =gridUrl; grid.dataSource.read(); grid.dataSource.refresh(); }});
source share