Skip to content

Commit

Permalink
fix: provide all search values
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoftic committed Jul 18, 2024
1 parent e34971d commit 0e97a1a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/vite-demo-vanilla-bundle/src/examples/example09.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ export default class Example09 {
enableCount: this.isCountEnabled, // add the count in the OData query, which will return a property named "__count" (v2) or "@odata.count" (v4)
enableSelect: this.isSelectEnabled,
enableExpand: this.isExpandEnabled,
filterQueryOverride: ({ fieldName, columnDef, columnFilterOperator, searchValue }) => {
filterQueryOverride: ({ fieldName, columnDef, columnFilterOperator, searchValues }) => {
if (columnFilterOperator === OperatorType.custom && columnDef?.id === 'name') {
let matchesSearch = (searchValue as string).replace(/\*/g, '.*');
let matchesSearch = searchValues[0].replace(/\*/g, '.*');
matchesSearch = matchesSearch.slice(0, 1) + CARET_HTML_ESCAPED + matchesSearch.slice(1);
matchesSearch = matchesSearch.slice(0, -1) + '$\'';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface BackendServiceFilterQueryOverrideArgs {
/** The inferred operator. See columnDef.autoParseInputFilterOperator */
operator: OperatorType;
/** The entered search value */
searchValue: any;
searchValues: any[];
/** A reference to the SlickGrid instance */
grid: SlickGrid | undefined
}
2 changes: 1 addition & 1 deletion packages/odata/src/services/grid-odata.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export class GridOdataService implements BackendService {
columnDef,
operator,
columnFilterOperator: columnFilter.operator,
searchValue,
searchValues: searchTerms,
grid: this._grid
});
}
Expand Down

0 comments on commit 0e97a1a

Please sign in to comment.