I am looking for some help regarding a feature of the Angular UI Grid. Specifically I am exploring filtering and while I was able to succes
An extension to the accepted answer is something I just discovered through trial and error. You can use regular expressions in the selectOptions
:
columnDefs: [
{
name: 'starRating',
headerCellClass: 'blue',
headerTooltip: 'Star Rating',
maxWidth: 100,
filter:
{
type: uiGridConstants.filter.SELECT,
selectOptions: [
{ value: /(THREE|FOUR|FIVE)/, label: 'Positive' }, // Here I wanted the user to be able to choose one option that would filter by several of the possible values in the data set
{ value: /(ONE|TWO)/, label: 'Negative' }, // ...and Here
{ value: 'ONE', label: '1' },
{ value: 'TWO', label: '2' },
{ value: 'THREE', label: '3' },
{ value: 'FOUR', label: '4' },
{ value: 'FIVE', label: '5' }
]
}
},