angular-ui / ui-grid

UI Grid: an Angular Data Grid
http://ui-grid.info
MIT License
5.39k stars 2.47k forks source link

FastWatch: redraw issues and console errors #3738

Open tobias-schreiner opened 9 years ago

tobias-schreiner commented 9 years ago

IE 11 on Windows 7

Using fastWatch: true causes error messages on the console (see below) and issues when redrawing the table.

In the debugger, I see that the "object", which lacks the methods as stated in the console errors, is actually a number. It turns out that columnDefsWatchFunction() is called with a number as parameter n, but obviously, it expects an array. This might result from using the function as watcher not only for $scope.uiGrid.columnDefs, but also $scope.uiGrid.columnDefs.length:

deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.columnDefs.length; }, columnDefsWatchFunction) );

Commenting out this one code line solved the mentioned issues for me, but probably brings other problems, since the watch does not detect adding and removing column definitions any more.

Console errors:

TypeError: Object doesn't support property or method 'filter' at getColDef (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:3671:5) at buildColumns (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:3784:7) at columnDefsWatchFunction (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:2638:11) at Scope.prototype.$digest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14129:23) at Scope.prototype.$apply (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14391:13) at done (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9567:36) at completeRequest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9752:7) at requestLoaded (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9695:9) TypeError: Object doesn't support property or method 'filter' at getColDef (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:3671:5) at buildColumns (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:3784:7) at columnDefsWatchFunction (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:2638:11) at Scope.prototype.$digest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14129:23) at Scope.prototype.$apply (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14391:13) at done (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9567:36) at completeRequest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9752:7) at requestLoaded (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9695:9) TypeError: Object doesn't support property or method 'forEach' at Grid.prototype.assignTypes (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:3701:5) at modifyRows (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:4107:5) at Anonymous function (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:2685:13) at processQueue (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:13071:11) at Anonymous function (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:13087:27) at Scope.prototype.$eval (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14287:9) at Scope.prototype.$digest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14103:15) at Scope.prototype.$apply (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14391:13) at done (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9567:36) at completeRequest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9752:7) TypeError: Object doesn't support property or method 'forEach' at Grid.prototype.assignTypes (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:3701:5) at Anonymous function (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:3848:9) at processQueue (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:13071:11) at Anonymous function (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:13087:27) at Scope.prototype.$eval (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14287:9) at Scope.prototype.$digest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14103:15) at Scope.prototype.$apply (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14391:13) at done (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9567:36) at completeRequest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9752:7) at requestLoaded (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9695:9) TypeError: Object doesn't support property or method 'forEach' at Grid.prototype.assignTypes (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:3701:5) at Anonymous function (http://localhost:8000/opsa/opsa/3rd/ui-grid/ui-grid.js:3848:9) at processQueue (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:13071:11) at Anonymous function (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:13087:27) at Scope.prototype.$eval (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14287:9) at Scope.prototype.$digest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14103:15) at Scope.prototype.$apply (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:14391:13) at done (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9567:36) at completeRequest (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9752:7) at requestLoaded (http://localhost:8000/opsa/opsa/3rd/angular/angular.js:9695:9)

ZackHine commented 8 years ago

Do you know when this fix will be in ui-grid?

MartijnWelker commented 8 years ago

When will this be merged ?

JZehet commented 8 years ago

Same here