2016-06-12 144 views
0

我正在使用角度ui datagrid框架,我需要使用唯一標識符過濾值。 我有以下代碼:Angular Ui數據網格過濾問題

var column = 
{name: 'distrito', field: 'distrito.id', type: 'number', 
displayName: 'Distrito', enableCellEdit: true, width: '135', 
cellFilter:'listagemFacesFilter:editDropdownOptionsArray:editDropdownIdLabel:editDropdownValueLabel:row.entity.distrito.distrito', 
editableCellTemplate: 'ui-grid/dropdownEditor', 
editDropdownIdLabel: 'id', editDropdownValueLabel: 'distrito', editDropdownOptionsArray: $scope.listaDistritos, 
filter: {type: uiGridConstants.filter.SELECT, selectOptions: $scope.listaDistritosFiltro} 
}; 

的$ scope.listaDistritosFiltro是ID爲(int)和值 一個數組列表(函數返回數組列表)

選擇,過濾所有的ID具有例如:ID = 1和ID = 12在同一時間,我只需要id = 1或id = 12的結果。

我認爲選擇過濾器是用字符串類型過濾的。

有人可以幫助我。

謝謝。 最好的問候, SMDC

+0

你可以嘗試格式化您的代碼,使其更易於閱讀 – Mike

回答

1

你可能在找這個過濾器 -

type: uiGridConstants.filter.EXACT