We are facing a problem with dhtmlxCombo control while filtering the options available in the list.
We are using
Standard Edition of dhtmlxCombo v 2.6. downloaded from link [dhtmlx.com/x/download/regula ... xCombo.zip](http://www.dhtmlx.com/x/download/regular/100722/dhtmlxCombo.zip).
enableFilteringMode() method of dhtmlxCombo object by passing single parameter as "true".
Ex : var z=dhtmlXComboFromSelect("html_select_control_id ");
z.enableFilteringMode(true);
Expected output : When user enters any number of characters in combobox then it should filter all the options containing entered character string.
Actual output : When user enters any number of characters in combobox it is filtering only those options starting with entered character string.
Is this known issue on autocomplete combobox ? Any pointers?
Is this resolved in Enterprize edition ?
After changing the js as above ,i meet the situation:
The select-down has the following values :
v3batchabc, v3batchaby .
when i type ‘‘ab’’, i find the value i just typed was changed to be ‘‘vb’’ ,do you know why that occur? If possible , could you please provide me the updated JS file and send me : paulojian@hotmail.co.uk
I’m sorry to resurrect this old thread, but all tips to change filtering to ‘includes’ does not work.
I am using the latest version of dhtmlxcombo and connector.
I have tried both of these tips:
[code]try{ var filter=new RegExp("^"+text,“i”); } catch (e){ var filter=new RegExp("^"+text.replace(/([[]{}()+*\])/g,"\$1")); }
======TO=======
try{ var filter=new RegExp(text,“i”); } catch (e){ var filter=new RegExp(text.replace(/([[]{}()+*\])/g,"\$1")); }
========AND====
if (text!=data[1]){
this.setComboText(data[1]);
dhtmlXRange(this.DOMelem_input,text.length+1,data[1].length);
}
======TO=======
if (text!=data[1]){
dhtmlXRange(this.DOMelem_input,text.length+1,text.length);
}[/code]
Changing both or just one does not enable filtering by includes. After changing the .jv I reload the page. Am I supposed to do something else after changing the two lines?
<script>
var z=new dhtmlXCombo("combo2","person",190);
z.enableFilteringMode(true,"includes/search_com_name.php",true);
function confirmComboValue(){combo.confirmValue();}
</script>
</form>
[/code]
.php that generates the valid XML to populate the combo box:
You are using dynamic loading when options are loaded according to the mask. We have not tested the solution with this mode. And moreover, connector returns suggestions for “start with” rule.
What is the initialization code for a combobox that uses filtering? Does that combobox have to be populated with static options? I would still like to load the options dynamically from php.
What is the initialization code for a combobox that uses filtering?
Check the sample dhtmlxCombo/samples/04_filtering/02_combo_filter.html
In this sample 2 last combos using dynamic loading. Others - simple filtering
I would still like to load the options dynamically from php.
In this case connector doesn’t fit, as it returns options for the start with mask. You use own script to generate xml. Something like dhtmlxCombo/samples/04_filtering/php/complete.php, but you need to use another “like” part in SQL query:
$sql = “SELECT DISTINCT item_nm FROM Countries Where item_nm like '%”.mysql_real_escape_string($mask)."%’";
instead of
$sql = “SELECT DISTINCT item_nm FROM Countries Where item_nm like '”.mysql_real_escape_string($mask)."%’";
I have the same problem that the characters are only matched from the beginning of the strings and not anywhere in the string.
I read the modification advice to the .js, yet was unable to locate that exact string in the dhtmlxcombo.js. I’m running v3.
Okay, got the “contain”-part to work.
Images showing too, after switching completely to the dhtmlXCombo initiation.
Now the only thing that remains unsolved is how to combat lukman’s problem from earlier.
Whenever I type a letter it automatically only shows those results conatining the character.
Unfortunately it replaces the letter with the first matching result, even if I’d like to type some more characters…
The string I am supposed to look for in the js-file is not to be found…again!.
In the js-file referenced in the HEAD-tag (codebase/dhtmlxcombo.js) there is no such string.
Only this which looks similar, but with different variables:
On the other hand there is the dhtmlxcombo.js in the sources subdirectory, in which the string exists, but that file is not called in the page header.
After referencing that file and making the advised changes it works!!
Why the two files? And more importantly why is the correct file never referenced in your tutorials?