我对ng-grid有疑问,我无法弄清楚。每当我点击一个单元格时,我都会收到此错误:
TypeError: undefined is not a function
at http://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.debug.js:3494:21
at h.$get.h.$broadcast (http://localhost:8080/carsweb/dist/js/vendor/angular/angular.min.js:103:414)
at ngGridDirectives.directive.focusOnInputElement (http://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.debug.js:2989:20)
at HTMLDivElement.focus (http://cdnjs.cloudflare.com/ajax/libs/ng-grid/2.0.11/ng-grid.debug.js:3034:21)
at http://localhost:8080/web/dist/js/vendor/angular/angular.min.js:27:15
at Array.forEach (native)
at q (http://localhost:8080/web/dist/js/vendor/angular/angular.min.js:7:255)
at HTMLDivElement.c (http://localhost:8080/cars/dist/js/vendor/angular/angular.min.js:26:492)
以下是网格的代码:
$scope.gridOptions = {
data: 'appLogData',
enableCellSelection: true,
enableRowSelection: false,
enableCellEditOnFocus: true,
columnDefs: [{field: 'appKey', displayName: 'appKey', enableCellEdit: true},
{field: 'appKeyGroup', displayName: 'appKeyGroup', enableCellEdit: true},
{field: 'appKeyValue', displayName: 'appKeyValue', enableCellEdit: true}]
};
我不确定angular.js和ng-grid的库是否会在某处发生冲突?我不太确定如何调试这个,所以任何关于那个或可能出错的提示都将不胜感激,谢谢。
更新
在这里我快速了解了我用于网格的appLogData:
版本: ng-grid v2.0.11 angular.js v1.2.4
我认为该错误与获得焦点的领域有关,我已经看到一些关于更改编辑模板和COL_FIELD在模板中出错的帖子,但我不确定如何修复它。