Skip to content

Commit

Permalink
fix: Filter model is now FilterConstructor and shouldn't be newed
Browse files Browse the repository at this point in the history
- the Filter `model` prop should be a constructor and it shouldn't newed (instantiated), it was defined like so in the docs and Wikis but that was actually wrong
- ref Slickgrid-Universal [PR 1430](ghiscoding/slickgrid-universal#1430)
  • Loading branch information
ghiscoding committed Mar 13, 2024
1 parent 83f7c75 commit cbda7ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/column-functionalities/filters/custom-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can also create your own Custom Filter with any html/css you want and/or jQu
{ id: 'description', name: 'Description', field: 'description', type: FieldType.string,
filterable: true,
filter: {
model: new CustomInputFilter() // create a new instance to make each Filter independent from each other
model: CustomInputFilter // create a new instance to make each Filter independent from each other
}
}
];
Expand Down
2 changes: 1 addition & 1 deletion src/examples/slickgrid/Example23.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class Example23 extends React.Component<Props, State> {
id: 'description', name: 'Description', field: 'description', filterable: true, sortable: true, minWidth: 80,
type: FieldType.string,
filter: {
model: new CustomInputFilter(), // create a new instance to make each Filter independent from each other
model: CustomInputFilter, // create a new instance to make each Filter independent from each other
enableTrimWhiteSpace: true // or use global "enableFilterTrimWhiteSpace" to trim on all Filters
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/examples/slickgrid/Example4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default class Example4 extends React.Component<Props, State> {
id: 'description', name: 'Description', field: 'description', filterable: true, sortable: true, minWidth: 80,
type: FieldType.string,
filter: {
model: new CustomInputFilter(), // create a new instance to make each Filter independent from each other customFilter
model: CustomInputFilter, // create a new instance to make each Filter independent from each other customFilter
enableTrimWhiteSpace: true
}
},
Expand Down

0 comments on commit cbda7ec

Please sign in to comment.