点击按钮上的角度ui网格过滤器

问题描述 投票:0回答:1

我是角色的新手。我们使用UI网格进行数据表示是可以自定义过滤进程的。我想以这种方式自定义它,过滤是在点击按钮时,而不是在keydown?这是个主意

$scope.search = function (){          
$scope.personCardGrid.useExternalFiltering = false; $scope.grid1Api.core.notifyDataChange(uiGridConstants.dataChange.ALL); 
$scope.gridApi.core.refresh() $scope.personCardGrid.useExternalFiltering = true;     
$scope.grid1Api.core.notifyDataChange(uiGridConstants.dataChange.ALL); 
$scope.gridApi.core.refresh() } 

问候

filter angular-ui-grid
1个回答
0
投票

您需要为列定义自己的headerCellTemplate。在模板中,还添加输入文本框和按钮。然后,在控制器中定义一个函数,并使用外部作用域调用它,该作用域将过滤记录。

© www.soinside.com 2019 - 2024. All rights reserved.