Typescript:
@ViewChild('dt', {static: true})
public dt: Table;
this.dt.filterConstraints['filterEvaluators'] = (evaluators: [], evaluatorsFilterName: []): boolean => {
const evaluatorsName = R.pluck('name', evaluators);
if (_.intersection(evaluatorsName, evaluatorsFilterName).length) {
return true;
}
};
How can I build this project without "filterConstraints" ?, i read table.d.ts and table.js. I realize that this "filterConstraints" has been removed without any changelog or document.
Please resolve this issue, thank you, it's urgent.
Same here.
This is because of the refactoring from the commit 658507f.
The filters has been exported to a specific class (renamed as FilterUtils), so the filters functions are no more a part of the class Table and we can't extend it anymore.
Is there another way to make custom filters now ?
I found a crappy way, this is not really a solution.
But you can do something like that :
const FilterUtils = require('primeng/components/utils/filterutils').FilterUtils;
FilterUtils.filterEvaluators = (evaluators: [], evaluatorsFilterName: []): boolean => {
const evaluatorsName = R.pluck('name', evaluators);
return _.intersection(evaluatorsName, evaluatorsFilterName).length > 0;
};
Sorry I can't use the syntax highlighter from the WYSIWYG...
Please PrimeNg, fix it, as we have to rework whole project without having the functionality removed! Its really annoying.
Creating custom filters for tables is a must-have feature, without which the tables are essentially worthless for all but the most basic things. Please bring this feature back in some form, in the meantime I'll keep using 8.0.2.
I still keep my project in 8.0.2, Update to 8.0.3 break all project, cry on my shouder :D
+1
This is the main issue preventing us from upgrading our project, there needs to be another Primeng way given to do this if the old way is being removed or the tables become very limiting
There is no upgrade path for us either without an option to add custom search functions. I can't really think of any project that I have worked on where we didn't at least implement a hand full of custom searches.
Try to use FilterUtils['filterEvaluators'] = ...
instead this.dt.filterConstraints['filterEvaluators'] = ...
We also use filterConstraints to customize the table filters, so we're stuck on 8.0.2 until a mechanism to extend the new FilterUtils class is implemented.
They are moved recently and we'll come up with an idea in 8.1.0 to provide extending the built-in filters.
Thank you for taking notice of this issue.
However, in the future, please take care to not break functionality with a revision release.
It was a good change to move outside of the table the filters, because now you only need to initialize and add custom filters one time at the start of the application.
( FilterUtils['customFilter'])
vs
this.dt1.filterConstraints['customFilter'] = ...
this.dt2.filterConstraints['customFilter'] = ...
this.dt3.filterConstraints['customFilter'] = ...
this.dt4.filterConstraints['customFilter'] = ...
Maybe someone likes custom filter to a specific table, so that's okay to have the previous behavior as complement, but i would recommend to make the filters outside of the table, to avoid the mess of initializing filters multiple times.
Now it is posible to use custom filters for dropdown, multiselect, nice feature.
I also really need custom filters. Currently I just stopped updating and fixed the version to 8.0.1.
Thank you, all. I updated Prime to latest version and refactor my code to FilterUtils.filterEvaluators.
It resolved my issued.
Same here.
In case someone need the showcase, @yigitfindikli has done it there: https://github.com/primefaces/primeng/commit/d27436c19fb747513d4fcb7a3662bb3d38f28c8e and https://stackblitz.com/edit/github-hemvcn?file=src%2Fapp%2Fapp.component.ts
There is no FilterUtils.filterEvaluators
anymore.
That's why i'm leaving primeng. Every new release there are breaking changes that breaks my project (themes dropped, Datalist
dropped, DataTable
to Table
, imports changes, Dialog.center()
, filterConstraints
, etc.). Many of them don't even have change notes.
They are not to be trusted, saddly.
Seems that they do this to force us to buy their products.
filterutils import change FROM V8 to V9
FROM: import { FilterUtils } from 'primeng/components/utils/filterutils';
TO: import { FilterUtils } from 'primeng/utils';
Most helpful comment
Thank you for taking notice of this issue.
However, in the future, please take care to not break functionality with a revision release.