Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add databound function after kendogrid has been initialized

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
}
like image 881
user1534664 Avatar asked Feb 07 '26 14:02

user1534664


1 Answers

Try this:

var grid = $("#grid").data("kendoGrid");
grid.bind("dataBound", function(e) {
    //your code here
});
like image 183
Vivek Parekh Avatar answered Feb 09 '26 08:02

Vivek Parekh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!