AngularJS UI网格过滤器或选项

AngularJS UI网格过滤器或选项,angularjs,angular-ui-grid,Angularjs,Angular Ui Grid,我们正在我们的一个项目中使用ui网格,目前我们可以在ui网格支持的每个列上应用两个过滤器。我们有如下所述的过滤器阵列: { field: 'age', filters: [ { condition: uiGridConstants.filter.GREATER_THAN, placeholder: 'greater than' }, { condition: uiGridConstants.filter.LESS_THAN,

我们正在我们的一个项目中使用ui网格,目前我们可以在ui网格支持的每个列上应用两个过滤器。我们有如下所述的过滤器阵列:

{ field: 'age', filters: [
    {
      condition: uiGridConstants.filter.GREATER_THAN,
      placeholder: 'greater than'
    },
    {
      condition: uiGridConstants.filter.LESS_THAN,
      placeholder: 'less than'
    }
  ]
这将返回与这两个条件都匹配的行。这太完美了

现在,我们想在这些过滤器之间添加“或”条件,以便两个过滤器都可以应用,或者其中一个可以应用。我看不到UI网格中对此功能的任何支持。你知道如何实现这个功能吗


任何帮助都将不胜感激。

网格中的范围与控制器的范围不同。因此,您必须使用grid.appScope:

var cellSelectTemplate = '<select ng-change="change(status, row.entity)" ng-model="status" ><option ng-repeat="stat in grid.appScope.dataStatuses" value="{{stat.id}}">{{stat.status}}</option></select>';
var-cellSelectTemplate='{{stat.status}}}';
更多信息:

对应用程序范围(ui网格的父范围)的引用 元素)。在ui网格控制器使用中分配 gridOptions.appScopeProvider重写的默认分配 $scope.$parent,带任何引用

从()