Can no longer use a string for the gridOptions.data property
As of 4.0.3, I can no longer set the value of the gridOptions.data property as a string. For 4.0.2, it works perfectly, but in 4.0.3+, the grid is not rendered.
Here is a plunker that shows the issue: http://plnkr.co/edit/J9Xr3AuxI28FfxtYQstG
I'm not sure, but I believe the problem is inside the dataWatchFunction, because the newData array becomes undefined here.
I am facing the same issue with updating from 4.0.2 to latest version, any workaround for this?
instead of using string in gridOptions.data, i am setting this value using service response. thanks for your clarification.
I had the same problem and I've replaced the string binding with an empty array that was getting updated whenever I had the data ready.
I've just run into this exact issue, first of all I believe that #6185 is a duplicate of this issue.
The problem was introduced here in v4.0.3 - where that fastWatch check was present previously it meant the newData value was provided by the scope watch instead of that block of code at the top of the function. This means that where previously the value would be extracted from scope directly it is now explicitly extracted from appScope with the following implications:
- appScope may not necessarily be the same as (or even related to) $scope. The data is pulled from appScope but the watch is attached to $scope, resolving the string expression against each of these may produce different values.
- the linked code resolving against appScope doesn't support "x.y.z" syntax, but resolving against $scope (as happens through the watches) does - #6185
I'd also like to note that the fastWatch option that features quite prominently in this area of the code doesn't appear to be documented anywhere.
Same issue. downgraded to 4.0.2
@mportuga Thoughts?
My guess is that it has to do with my changes to try and reduce the number of digest cycles: https://github.com/angular-ui/ui-grid/commit/205a2151e7d1d31dd6a78866d0413d97487769bf https://github.com/angular-ui/ui-grid/commit/e6ab96bbae7d1ec5848a65974f5addea8e012589 https://github.com/angular-ui/ui-grid/commit/56f0dc11978b9231373435d9e73da81375b5cda7
@mportuga this was caused by https://github.com/angular-ui/ui-grid/commit/75f98c3eda3e46f14f9d924e6f5a6d6e35bcc2b5#diff-d586707ee1c4e842337e09afc6ebd587L87
We should be probably just restore the if ( self.grid.options.fastWatch ){....