Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Andrea Frigo on Oct 07, 2008 10:33
open dhtmlx forum
ComboBox partial in string matching

Is it possible to filter items in a combo matching not only the first part of a string, but also fragments?
Example:

With an option list like:
adsdasXXXjsdf
XXXjhsdfsfhjfsdjk
hdsfjhXXX
fsdsdfYYY
addasYYY
YYYjjksdfjk

Match XXX to those options:
adsdasXXXjsdf
XXXjhsdfsfhjfsdjk
hdsfjhXXX

Or match YYY to those options:
fsdsdfYYY
addasYYY
YYYjjksdfjk

Actually I obtain with XXX only one match:
XXXjhsdfsfhjfsdjk

Thanks,
Andrea frigo
Answer posted by Support on Oct 08, 2008 03:41
Can be achieved only by code modification

dhtmlxcombo.js , line 980
     try{ var filter=new RegExp("^"+text,"i"); }  
can be replaced with 
     try{ var filter=new RegExp(text,"i"); }  

with such modification, filter will react on any occurence of entered text