Combo: If no value in combo then show all

Hi,

I have a dhtmlXCombo setup that loads a XML file generated by a PHP file based on user input.
In the PHP file I have set it up so that if the PHP file returns a blank value ($foobar == ‘’), all the rows will be fetched from database table. If a value different from blank value ($foobar != ‘’), then we will do a SQL search with LIKE ‘$foobar%’.

Okay… Fine enough!

Now: If there is no value in the combobox when it is opened up, i want the menu to fetch all rows from database.

How can I accomplish this? Because right now when I try to open the menu if no value is entered, the menu will never open up.

Any suggestion is warmly welcome.

Thank you in advance.

Hi,

if all options are loaded at once when the mask is empty, why do you use dynamic loading ?
It would be better to use the following:

combo.enableFilteringMode(true);
combo.loadXML(url); /xml that contains all the options/

instead of

combo.enableFilteringMode(true,url);

In this case all options will be loaded at once and behave as you need.

Yes Alexandra, you are correct.

I found this out yesterday while digging deeper in to the documentation.

Sorry for this and thank you as usual!

(PS! I am now a paying customer of the complete suite. Why? Because your scripts are simply magnificent!)