Completed
Last Updated: 13 Mar 2020 09:55 by ADMIN
Imported User
Created on: 03 Aug 2015 08:11
Category: Data Source
Type: Feature Request
3
Ignore diacritics when filtering
Ignore language specific characters when filtering. Example: search phrase "Deja" should find word "Déjà".
1 comment
ADMIN
Georgi
Posted on: 13 Mar 2020 09:55

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

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.