Schwarts Hiddwnbroug
Schwarts Hiddwnbroug

Reputation: 15

Angular Ui data-grid filtering issue

I'm using the angular ui datagrid framework and I need to filter values with unique identifiers. I have the following code:

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}
};

the $scope.listaDistritosFiltro is a arraylist with id (int) and value (function returns arraylist)

The selection, filter all id's with example: id= 1 and id =12 at the same time and i need only results with id=1 or id=12.

I think the selection filter is filtering with string type.

Someone can help me, please.

Thanks. Best Regards, SMDC

Upvotes: 0

Views: 224

Answers (1)

Pratik Bhat
Pratik Bhat

Reputation: 7614

You are probably looking for this filter -

 type: uiGridConstants.filter.EXACT

Upvotes: 1

Related Questions