I am not able to restrict some rows to not get filtered when a filtering is applied to a column
How can Restrcit a particular row values from getting filtering out from Column DropDown Filter Feature
Do you have any pictures you can share with us before applying filter and after applying it, please?
@noajm Thank you for your prompt response Actually I fixed the issue by reading the documentation it allowed to restrict some values
afterFilter() {
const filtersRowsMap = this.getPlugin('filters').filtersRowsMap;
filtersRowsMap.setValueAtIndex(0, false);
},
That is a nice answer!
Much better than mine, as mine is still not working and has way more lines haha.
After the filter has been clicked, I would the following when event get triggered
afterDropdownMenuHide: function () {
setIsFilterOn(true);
}
Then, if the filter is true, I would manually insert that particular row to a fixed index to my current data by doing:
useEffect(() => {
if (isFilterOn) {
const newData = [...data];
newData.splice(2, 0, { car: "Test", year: 'Year', owner: 'Owner' });
setData(newData);
}
}, [isFilterOn]);
However, I would still need to avoid duplications if the filter is set to filter columns containing the word “Test.”
So, yours is away cleaner.
Can I ask why or what adjusting the filter needed for?
Yes By using the my method you can easily restrict any filter to get it applied on any of the row. in your case you can first identify the rows which need to restricted from your data and set it dynamically to exclude the particular rows
Do you need any further help regarding this subject? If so please share your recent progress details.