Hello, I have a grid that contains the results of an ad hoc query search. My requirements are for this sortable table to be displayed empty on the form when the user first enters the page, then populate it after they fill out the search criteria and submit, hence the autoBind:false.
$("#userGrid").kendoGrid(
{
dataSource: userSearchDS,
sortable: true,
autoBind: false,
height: 200,
scrollable: true,
columns:
[
{ field: "penName", title: "Pen Name" },
{ field: "userNumber", title: "User ID", width: 150 }
]
});
The problem is that if you click on one of the columns while the table is empty, it calls read on your datasource, thus populating itself. I believe this to be a bug, but assuming it wasn't, I went about trying to create the table with sortability turned off, then turning it back on when the search is performed. This is proving to be difficult and I'm finding myself down a rathole of javascript surgery, so a patch or an alternative solution would be appreciated.
Additionally, I have a reset button that will clear out the contents of table using this JQuery function:
$.fn.clearKendoGrid = function()
{
var data = $(this).data("kendoGrid").dataSource._data;
data.splice(0, data.length);
$(this).data("kendoGrid").refresh();
}
If I click the sortable column on the empty grid, I am no longer able to clear the contents out with this function, which is weird. I haven't had the time to investigate further, though.
$("#userGrid").kendoGrid(
{
dataSource: userSearchDS,
sortable: true,
autoBind: false,
height: 200,
scrollable: true,
columns:
[
{ field: "penName", title: "Pen Name" },
{ field: "userNumber", title: "User ID", width: 150 }
]
});
The problem is that if you click on one of the columns while the table is empty, it calls read on your datasource, thus populating itself. I believe this to be a bug, but assuming it wasn't, I went about trying to create the table with sortability turned off, then turning it back on when the search is performed. This is proving to be difficult and I'm finding myself down a rathole of javascript surgery, so a patch or an alternative solution would be appreciated.
Additionally, I have a reset button that will clear out the contents of table using this JQuery function:
$.fn.clearKendoGrid = function()
{
var data = $(this).data("kendoGrid").dataSource._data;
data.splice(0, data.length);
$(this).data("kendoGrid").refresh();
}
If I click the sortable column on the empty grid, I am no longer able to clear the contents out with this function, which is weird. I haven't had the time to investigate further, though.