Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Cory on Jan 04, 2010 09:43
open dhtmlx forum
Make combobox accent insensitive

Hi !

I'm trying to make combobox's text search be accent insensitive. The idea is to make 'éléphant' match 'elephant' and vice versa.
The theoretical way to proceed is to convert the strings to unicode since unicode can correctly match the accented variations of a letter. I've done the theorectical bit here : http://jecodeavecmespieds.over-blog.com/article-regexp-sans-tenir-compte-des-accents-40974922.html
But I'm having trouble bringing the theory into combobox. Any clue of how to get this through (I actually believe it should be integrated into the main combobox source once working since it's a problem for many languages) ?
Answer posted by Alex (support) on Jan 05, 2010 05:48

Hello,

it is possible to make combobox's text search be accent insensitive by modifications in dhtmlxcombo.js, filterSelf method. Try to locate the following method and do the modifications that are written in comments:

...

 dhtmlXCombo.prototype.filterSelf = function(mode)
  {
  var text=this.getComboText();
 /*the text variable should be converted using the regular expression*/

...

for(var i=0; i<this.optionsArr.length; i++){

/*this.optionsArr[i].text should be converted and used in the following method*/
  var z=filter.test(this.optionsArr[i].text);
...

}

...

Answer posted by Cory Chaplin on Jan 05, 2010 06:10
Heh, I got that far ;)
My problem is with the next  step