Ignore language specific characters when filtering. Example: search phrase "Deja" should find word "Déjà".
Hi,
Currently the filter object accepts not only a string as its operator, but also a handler. In other words, you could implement your own operator which ignores the language specific characters.
e.g.
var dataSource = new kendo.data.DataSource({
data: [
{ name: "Jãnê Doe" },
{ name: "John Doe" }
]
});
dataSource.filter( { field: "name", operator: function(item, filterValue){
return item
.replace(/[áàãâä]/gi,"a")
.replace(/[éè¨ê]/gi,"e")
.replace(/[íìïî]/gi,"i")
.replace(/[óòöôõ]/gi,"o")
.replace(/[úùüû]/gi, "u")
.replace(/[ç]/gi, "c")
.replace(/[ñ]/gi, "n")
.replace(/[^a-zA-Z0-9]/g," ").startsWith(filterValue);
}, value: "Jane" });
Below you will find a sample which demonstrates the above approach:
Regards,
Georgi
Progress Telerik