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

AngularJS grid rebind clears rows before refreshing

2 Answers 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 26 Sep 2014, 08:20 PM
When using the k-rebind attribute in the grid it will rebind correctly but first it clears all the data. I have made a Demo Here to illustrate my point. I couldn't find any reference to this in any other threads.

Demo Link: http://dojo.telerik.com/iviT

2 Answers, 1 is accepted

Sort by
0
Mihai
Telerik team
answered on 29 Sep 2014, 07:47 AM
Hi,

It's not a bug, it's the normal behavior of k-rebind.

k-rebind will force a widget to rebuild when the variable in scope has changed.  What this effectively means is that the widget is first destroyed, and then re-created.  That's why you see it initially empty while the data reloads.

Regards,
Mihai
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Tim
Top achievements
Rank 1
answered on 29 Sep 2014, 03:17 PM
I found that the way to best fix the issue was to create a variable from the grid "kendo-grid='grid'" and then have the k-on-change call grid.dataSource.read(), so that the grid is not recreated everytime but rather refreshed. I showed this in the Demo Here.

Demo Link: http://dojo.telerik.com/iviT/3
Tags
Grid
Asked by
Tim
Top achievements
Rank 1
Answers by
Mihai
Telerik team
Tim
Top achievements
Rank 1
Share this question
or