There is an item in the documentation that can be prepared a custom function for filter in question it says that the value has to be searched without the dots, dash and slash, so inside the settings
in the columns
set item within the field referring to cnpj
filterFunction
same as below:
settings = {
columns: {
id: {
title: 'ID'
},
name: {
title: 'Full Name'
},
cnpj: {
title: 'Cnpj',
filterFunction(cell: any, search?: string): boolean {
const searchNumber = search.replace(/\D/g, '');
const cellNumber = cell.replace(/\D/g, '');
return cellNumber.includes(searchNumber);
}
},
email: {
title: 'Email'
}
}
};
In function:
filterFunction(cell: any, search?: string): boolean {
const searchNumber = search.replace(/\D/g, '');
const cellNumber = cell.replace(/\D/g, '');
return cellNumber.includes(searchNumber);
}
Values are passed to two other variables without the dots, dash and bar making it easier to search there and with the includes
function checked, whether the values are contained, regardless of whether they are typed with or without formatting. / p>
References: