This is a migrated thread and some comments may be shown as answers.

Prevent Kendo grid data bind events when updating multiple model properties

2 Answers 823 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 10 Mar 2014, 09:59 AM
Hi, 
I'm updating multiple properties on a Kendo datasource row model (using model.set javascript), and I want the grid to update only after the last change is made. Another issue is that i don't know (without many if statements) whether any of the properties actually changed.
Regards, 
Tom

2 Answers, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 11 Mar 2014, 03:08 PM
Hi Tom,

You can prevent the data bind action at the dataBinding event. For example:
var grid = $("#grid").data("kendoGrid");
 
grid.bind("dataBinding", function(e) { e.preventDefault(); });
//begin modifying the data
//.....
//finish modifying the data
grid.unbind("dataBinding");
grid.refresh();

I hope this solution will fit in your scenario.

Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Tom
Top achievements
Rank 1
answered on 18 Mar 2014, 08:50 AM
Thanks Alexander, that did the trick!
Tags
Grid
Asked by
Tom
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Tom
Top achievements
Rank 1
Share this question
or