【问题标题】:Can we hide certain rows in ng-grid based on its values?我们可以根据其值隐藏 ng-grid 中的某些行吗?
【发布时间】:2014-10-22 09:06:21
【问题描述】:

我有一个值数组。

Questions = [
           {Name:"First", Status:"Valid"},
           {Name:"Second", Status:"Invalid"},
           {Name:"Third", Status:"Valid"},
           {Name:"Fourth", Status:"Invalid"}
           ];

我可以在 ng-grid 中显示这些。但是如果 Status 的值为 Invalid,我可以隐藏一行吗?

【问题讨论】:

    标签: angularjs ng-grid


    【解决方案1】:

    需要设置gridOptionsfilterOptions属性

    $scope.filterOptions = {
        filterText: 'Status:Valid',
        useExternalFilter: true
    };
    
    $scope.gridOptions = {
        data: 'Questions',
        filterOptions: $scope.filterOptions
    };
    

    【讨论】:

    • 谢谢!有效。但没有 useExternalFilter: true.
    猜你喜欢
    • 2016-06-17
    • 2013-08-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-15
    • 2016-06-21
    • 2013-07-24
    相关资源
    最近更新 更多