2017-07-24 56 views
0

我一直在努力与此错误一段时间, 我想创建一个下拉列表的ui网格上的过滤器功能,但我似乎得到一个TypeError:无法读取未定义的属性'SELECT',错误发生在类型为:uiGridConstants.filter.SELECT的行中。角ui网格类型错误:无法读取undefined的属性'SELECT'

这里是我的代码:


var columnDefs = [ 
      {name: "Updated by", field: "updatedBy", enableHiding: false, enableSorting:true, width: "*",enableFiltering: false}, 
      {name: "Date Updated", field: "updatedDateTime", enableHiding: false, enableSorting:true,width: "*",enableFiltering: false}, 
      {name: "Action Group", field: "actionGroup", enableHiding: false,enableSorting: true, 
       filter: { 
        type: uiGridConstants.filter.SELECT, 
        selectOptions: groupTypes 
       } 
      }, 
      {name: "Action Performed", field: "actionPerformed", enableHiding: false, width: "75%"} 
     ]; 

我已经试过UI网的教程页面上的引导下,但继续运行这个错误 感谢

回答

1

发现的原因问题,基本上我是通过uiGridConstants以错误的顺序传递给函数,例如:

原来是这样的:

XXX.controller('XXXController', ['$location', '$scope','uiGridConstants', '$route', '$http', function ($location, $scope, $route, $http,uiGridConstants) 

它应该是什么:

XXX.controller('XXXController', ['$location', '$scope','uiGridConstants', '$route', '$http', function ($location, $scope,uiGridConstants, $route, $http) 

我知道这是一个非常愚蠢的错误,但希望有人有一天会看到这一点,不要浪费时间,像我一样

+0

好,你抓住了自己的麻烦。 :) – GOK

相关问题