-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed #14432 #14433
Fixed #14432 #14433
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Hi, You should use filterGlobal method instead of modifying filter method, it's not for global filtering. Please see the example: https://stackblitz.com/edit/github-8nu6jf?file=src%2Fapp%2Fapp.component.ts I've reverted this PR in #15053 because it introduced new breaking changes in #14588 and #14903 |
This is a filter-specific correction, solving the problem when there are multiple filters for the same field (complex), however I understand that it has generated an unintended impact on simple filters this.filters[field] = field == 'global'? { value: value, matchMode: matchMode } : [{ value: value, matchMode: matchMode }]; filter(value: any, field: string, matchMode: string) {
if (this.filterTimeout) {
clearTimeout(this.filterTimeout);
}
if (!this.isFilterBlank(value)) {
this.filters[field] = { value: value, matchMode: matchMode };
this.filters[field] = field == 'global'? { value: value, matchMode: matchMode } : [{ value: value, matchMode: matchMode }];
} else if (this.filters[field]) {
delete this.filters[field];
}
this.filterTimeout = setTimeout(() => {
this._filter();
this.filterTimeout = null;
}, this.filterDelay);
this.anchorRowIndex = null;
}
filterGlobal(value: any, matchMode: string) {
this.filter(value, 'global', matchMode);
}
The mention of the 'global' type within the filter function is to maintain the existing behavior given that the 'filterGlobal' function calls the 'filter' filterGlobal(value: any, matchMode: string) {
this.filter(value, 'global', matchMode);
} It is necessary to look for a solution that meets both scenarios of #14433 and #14903, Expected outcome: *I'm using the English translator, sorry if I don't express myself well |
Performing the fix for the filters and maintaining the global filtering behavior