Hello,
Is there a way to achieve accent insensitive search with showfilterrow = true and filtertype = ‘input’ ?
I have halfway achieved it by setting the datafield in my column definitions to the values lowercased + without accents, and displayfield to the true values.
That way I can find data that actually has accents without writing accents in the filterrow (e.g. I can find “Aurélien” by searching “aurelien”) ; but I also need to strip the filter value of its accents when filtering (so that I can find “aurelien” by searching “Aurélien”).
I tried to listen on the ‘filter’ event and replace the filter value when necessary, but that triggers an infinite recursion :
$grid.on('filter', function (e) {
const filterinfo = $grid.jqxGrid('getfilterinformation');
let hasDiff = false;
for (let f of filterinfo || []) {
const filterDetail = f?.filter?.getfilters?.()?.[0];
const value = filterDetail?.value;
if (typeof value === 'string' && filterDetail?.type === 'stringfilter') {
const noAccent = workListGrid.removeAccents(value);
if (value !== noAccent) {
$sendingsGrid.jqxGrid('removefilter', f.datafield, false);
const group = new $.jqx.filter();
const newFilter = group.createfilter(filterDetail.type, noAccent, filterDetail.condition);
group.addfilter(0, newFilter);
$grid.jqxGrid('addfilter', f.datafield, group, false);
hasDiff = true;
}
}
if (hasDiff) {
$grid.jqxGrid('applyfilters');
$grid.jqxGrid('refreshfilterrow');
}
});
});
Do you have any tips to achieve this ?
Thanks for your help,
Aurélien