Cannot read property 'find' of null
I'm getting an error when I use an ng-grid inside of a ui.router template and use the $state.go() method to transition:
TypeError: Cannot read property 'find' of null at self.setDraggables (ng-grid-2.0.11.debug.js:1040:37) at angular.js:14158:28 at completeOutstandingRequest (angular.js:4337:10) at angular.js:4638:7
If I manually type in a different routing url, the error does not occur. When I use $state.go(), it seems that the relevant method is being called twice for each table, once with grid.$root = null, and once with it properly set. Since I have grids on both of the templates, I'm not sure if its the grids I'm replacing or adding that have the problem. Based on the fact that self.setDraggables only seems to be called from $on('$destroy'), its probably the former.
Same issue here since I use routes. Manual switch works, but this error block the routeChange.
Did you find a fix or something ?
I'm seeing the same behavior. It appears the grid.$root is not being updated on programatic route changes before the draggables are being set (setDraggables() function: line 1048). I'm using location.path to change the route in order to get this error. I'm only getting this in chrome at present and I noticed that the code seems to be meant for FireFox based on the comments.
I too have this same error. I am also using location.path.
Same thing here: I upgraded from 2.0.7 to 2.0.12 today, and I now get this error when an ngGrid is removed from the DOM (with a ng-if or ng-repeat) while being rendered. On chrome only, not on firefox.
+1
Working plunker here with ui-router: http://plnkr.co/edit/ZgfJoq?p=preview (I checked in Chrome).
Closing unless you can show me how to reproduce.
The same for me. You can check the error transitioning to an event passing a param. Here you can find your plunker forked with the issue: http://plnkr.co/edit/6AcF9VWXiPSnGN4lGUNO?p=preview
+1
Please create new release
Could really use a new release with this fix, as we're still not ready to upgrade to "ui.grid"
Adding weight to the issue as well - seeing the same problem on my end.
+1
+1
+1
+1
+1
I'm closing since we're not supporting 2.x anymore. If anyone is willing to take on this, feel free to fork.