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

[Solved] Grid Angular k-rebind issue since Q3 update

6 Answers 334 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 19 Dec 2014, 05:34 PM
The scenario is we're using AngularJS and we're loading the options for the grid dynamically from the server so we need to use k-rebind on the options to make the options refresh from the server call. This used to work fine but has stopped working since the latest update. We've constructed an example based on the Telerik grid demo site. The issue is that the grid refreshes whenever you do any http activity during a grid resize or reorder event. As you can see, it works if you change the version back to Q2 SP2:

http://dojo.telerik.com/IGiDI

Please advise if there's anything specific we need to make this work.

6 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 23 Dec 2014, 12:25 PM
Hi Anthony,

Indeed, I managed to reproduce the issue, however we will need more time to analyze what exactly is causing this behavior. It seems like the $http.get triggers the $scope's change, which result in rebinding the Grid. Replacing the Angular get with a jQuery get seems to work as expected and could be used as a workaround while we investigate.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anthony
Top achievements
Rank 1
answered on 02 Jan 2015, 10:22 AM
Hi Alexander, thanks for your response, we hope the investigation is going well. 

Replacing the Angular get with jQuery only delays the issue as any other Angular changes on the page (ng-click, ng-mouseover, etc) will force a digest loop and cause the Grid to rebind.

In this example, clicking the button reloads the Grid, but if you remove the k-rebind attribute then it won't reload:

http://dojo.telerik.com/IGiDI/2
0
Petyo
Telerik team
answered on 06 Jan 2015, 11:47 AM

Hello Anthony,

I am sorry for the delayed response. The case turned out to be quite complex. The reason for the behavior we observe is that the grid updates its options object with the newly set column widths. Once that happens, the next digest cycle detects a change in the options and re-inits the grid. This definitely seems like something we should fix, but the code design does not accommodate the means to skip widget rebind in certain conditions. We will look into that further. 

For now, the simplest workaround I may suggest is to narrow down the k-rebind attribute to the field which is actually going to change. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anthony
Top achievements
Rank 1
answered on 06 Jan 2015, 05:18 PM
Hi Petyo,

Thank you for providing an update - it is useful to know what the issue is as we may be able to develop a work-around ourselves.

Unfortunately, we've found that we need to assign the whole options object to the k-rebind attribute.
The options, including data source URL, are constructed dynamically by the server - once the server has responded with the URL the Grid options are updated, forcing the grid to update.

We have looked at monitoring just the DataSource component of the options but that doesn't seem to work - we shall look into this further while we await an official update.

Kind regards,
Anthony
0
Petyo
Telerik team
answered on 08 Jan 2015, 08:58 AM

Hello Anthony,

monitoring just the datasource component is the way to go. By the way, we have addressed several k-rebind related issues in the internal builds released after the Q3 official one - you may give them a try. If updating the script reference to an internal build does not work, can you please send us your updated sample? We will look into it more closely. 

Regards,
Petyo
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Anthony
Top achievements
Rank 1
answered on 13 Jan 2015, 02:20 PM
Hi Petyo,

Apologies for the slow response.
The latest internal build (1308) appears to resolve the issue if we only monitor the dataSource property of the options object.

Thanks for your help,
Anthony
 
Tags
Grid
Asked by
Anthony
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Anthony
Top achievements
Rank 1
Petyo
Telerik team
Share this question
or