angularjs中的UI网格中的列过滤不起作用 [英] Column filtering in UI-grid in angularjs is not working
问题描述
我正在使用ui grid作为我的应用程序。我必须使用列过滤器。我正在尝试将enableFiltering属性应用于网格,但它无法正常工作。我错过了什么吗?
我的尝试:
$ scope.gridData = [{
名称:Moroni,
年龄:50,
部门:'HR'
},{
名称:天赐,
年龄:43,
部门:'GM'
},{
名称:雅各布,
年龄:27
},{
名称:Nephi,
年龄:29
},{
名称:Enos,
年龄:34
}];
$ scope.columnDefs = [{
name:'First Name ',
字段:'名称',
},{
名称:'年龄',< br $>
字段:'年龄',
宽度:30%
},{
名称:'部门',
字段:'部门',
宽度:30%,
}]
$ scope.grid = {
data:$ scope.gridData,
columnDefs:$ scope.columnDefs,
enableColumnMenus:false,
enableColumnMoving:true,
enableFiltering:true,
}
I am using ui grid for my application. I have to use column filter. I am trying to apply the enableFiltering property to the grid but its not working. Am I missing something?
What I have tried:
$scope.gridData = [ {
name : "Moroni",
age : 50,
department : 'HR'
}, {
name : "Tiancum",
age : 43,
department : 'GM'
}, {
name : "Jacob",
age : 27
}, {
name : "Nephi",
age : 29
}, {
name : "Enos",
age : 34
} ];
$scope.columnDefs = [ {
name : 'First Name',
field : 'name',
}, {
name : 'Age',
field : 'age',
width : "30%"
}, {
name : 'Department',
field : 'department',
width : "30%",
} ]
$scope.grid = {
data : $scope.gridData,
columnDefs : $scope.columnDefs,
enableColumnMenus : false,
enableColumnMoving : true,
enableFiltering : true,
}
推荐答案
scope.gridData = [{
名称:Moroni,
年龄:50,
部门:'HR'
},{
名称:Tiancum,
年龄:43,
部门:'GM'
},{
名称:Jacob,
年龄:27
},{
名称:Nephi,
年龄:29
},{
名称:Enos,
年龄:34
}];
scope.gridData = [ {
name : "Moroni",
age : 50,
department : 'HR'
}, {
name : "Tiancum",
age : 43,
department : 'GM'
}, {
name : "Jacob",
age : 27
}, {
name : "Nephi",
age : 29
}, {
name : "Enos",
age : 34
} ];
scope.columnDefs = [{
name:'First Name',
字段:'name',
},{
名称:'年龄',>
字段:'年龄',
宽度:30%
},{
名称:'部门',
字段:'部门',
宽度:30%,
}]
scope.columnDefs = [ {
name : 'First Name',
field : 'name',
}, {
name : 'Age',
field : 'age',
width : "30%"
}, {
name : 'Department',
field : 'department',
width : "30%",
} ]
scope.grid = {
数据:
scope.grid = {
data :
这篇关于angularjs中的UI网格中的列过滤不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!