angular-ui/ui-grid

FastWatch: redraw issues and console errors

已關閉

#3,738 建立於 2015年6月9日

 (3 則留言) (0 個反應) (1 位負責人)JavaScript (2,496 個分叉)batch import
help wantedtype: bug

倉庫指標

星標
 (5,395 顆星)
PR 合併指標
 (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)

貢獻者指南