【问题标题】:Angular-gantt | Filter tasks - make it shows only rows with filtered task?角甘特图 |过滤任务 - 让它只显示过滤任务的行?
【发布时间】:2015-08-12 14:25:03
【问题描述】:

https://www.angular-gantt.com/demo/

正如你在这个网站上看到的,如果你过滤任务,那么它只会隐藏其他任务。

如何让它只显示带有过滤任务的行?

【问题讨论】:

    标签: angularjs gantt-chart


    【解决方案1】:

    使用 filter-row 属性,将您的过滤器功能放入控制器中,并在此处“反转”您的逻辑。如果 filter-function 将返回此行,则该行将可见,否则不可见。 这是一个例子:

    $scope.calendarFilter = function(row, $index) {
    
      if ($scope.calendar.filter == 'all') {
        return row;
      } else {
        if ($scope.calendar.filter.id == row.model.typeId ) {
          return row;
        }
      }
    

    };

    Source here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-01
      • 2018-04-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多