angular-ui/ui-grid

FastWatch: redraw issues and console errors

Open

#3,738 创建于 2015年6月9日

在 GitHub 查看
 (3 评论) (0 反应) (1 负责人)JavaScript (2,496 fork)batch import
help wantedtype: bug

仓库指标

Star
 (5,395 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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)

贡献者指南