angular-ui/ui-grid

How to hide or extend clear all filters

Open

#6,146 创建于 2017年4月3日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)JavaScript (5,395 star) (2,496 fork)batch import
help wantedtype: enhancement

描述

Hello,

Is it possible to hide clear all filters from grid menu? I want to have options enableFiltering: true, but I don't want to have "Clear All Filters" in Grid Menu.

Why I want to hide that is because I made my custom menu item "Remove all filters" which removes ( clear ) searches, grouping & selected rows.

        gridMenuCustomItems: [
          {
            title: "Reset all filters",
            action: function($event){
              console.log($scope);
              $scope.gridApi.grouping.clearGrouping(); // clear grouping
              $scope.gridApi.selection.clearSelectedRows(); // clear selected rows
              $scope.gridApi.core.clearAllFilters(); // clear search
              // $scope.gridApi.pinning.pinColumn("");  // clear pinned columns
            },
          }
        ],

If it is not possible to hide "Clear all filters" is it possible to extend that functionallity and add options for removing grouping and selected rows.

Thanks in advance

贡献者指南