Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit e9962cd

Browse files
Ghislain BeaulacGhislain Beaulac
authored andcommitted
fix backend filter with a dropdown (select), should call EQ instead of Contains
1 parent f012017 commit e9962cd

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/app/modules/angular-slickgrid/services/filter.service.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ export class FilterService {
194194
this._columnFilters[args.columnDef.id] = {
195195
columnId: args.columnDef.id,
196196
columnDef: args.columnDef,
197-
searchTerm: e.target.value
197+
searchTerm: e.target.value,
198+
operator: args.operator || null
198199
};
199200
}
200201

@@ -254,7 +255,7 @@ export class FilterService {
254255
switch (filterType) {
255256
case FormElementType.select:
256257
case FormElementType.multiSelect:
257-
elm.change((e: any) => this.callbackSearchEvent(e, { columnDef }));
258+
elm.change((e: any) => this.callbackSearchEvent(e, { columnDef, operator: 'EQ' }));
258259
break;
259260
case FormElementType.input:
260261
default:

src/app/modules/angular-slickgrid/services/utilities.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ export function mapOperatorType(operator: string): OperatorType {
186186
break;
187187
case '<>':
188188
case '!=':
189+
case 'neq':
190+
case 'NEQ':
189191
map = OperatorType.notEqual;
190192
break;
191193
case '*':
@@ -199,8 +201,19 @@ export function mapOperatorType(operator: string): OperatorType {
199201
break;
200202
case '=':
201203
case '==':
204+
case 'eq':
205+
case 'EQ':
202206
map = OperatorType.equal;
203207
break;
208+
case 'in':
209+
case 'IN':
210+
map = OperatorType.in;
211+
break;
212+
case 'notIn':
213+
case 'NIN':
214+
case 'NOT_IN':
215+
map = OperatorType.notIn;
216+
break;
204217
default:
205218
map = OperatorType.contains;
206219
break;

0 commit comments

Comments
 (0)