Reputation: 3418
Let's say I have initialized a kendogrid like this.
$('#' + grids[i].gridName).kendoGrid({
columns: [{
width: 50, "template": "<input type=\"checkbox\" />"
},
{
field: "Name",
title: "Name"
}]
}).css('width', '100%');
How can I add a databound function to the already existing kendoGrid?
The following does not work.
$("#grid").data("kendoGrid").dataBound = function(){
//some code
}
Upvotes: 3
Views: 2557
Reputation: 3019
you may add databound function as below
$('#grid').data().kendoGrid.dataSource.bind('dataBound', function(e) {
...
});
Upvotes: 1
Reputation: 1085
Try this:
var grid = $("#grid").data("kendoGrid");
grid.bind("dataBound", function(e) {
//your code here
});
Upvotes: 3