http://dojo.telerik.com/IGiDI
Please advise if there's anything specific we need to make this work.
6 Answers, 1 is accepted
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
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
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
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
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
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