Combobox - Dynamic Dropdown List

Hi there, i am having problem with dynamic dropdown list. my list is generated on the fly while user is typing the letter in the box. But the list displays duplicates of one item. for instance, if we have records “abc” “abb” “abcdefg” in the database.
user types “ab” then the list displays fine. when user’s input gets to “abc”, the matched option is displayed which is “abcdefg”. if user keeps typing “abcd” and then “abcde” and then “abcdef”. the list then will be displaying “abcdefg” several times depending on how many time the database had been queried until it returned no result.
i believe the problem is caused by the xml content has not got cleaned before a new xml list is returned from the database query. tried to modify dhtmlxcombo.js but had no luck.

please would someone can help me?

Hi,

make sure that server-side script generates desired xml (that doesn’t contain duplicate items). Please check ready combo samples:
dhtmlxCombo/samples/04_filtering/02_combo_filter.html
the same on our website:
dhtmlx.com/docs/products/dht … ilter.html

thanks for your reply but i am pretty sure the returned xml from the server is a clean list of items with no duplications. i have checked that in firebug. it shows the returned xml in its console and the list contains only one record.

i presume the combobox caches the previous data. please have a look at the list i have attached. it displays the one item several times as you can see from the picture. the list will get longer and longer with the same item on the list if you keep typing in the combobox.

please help me with other question i have had: how do you disable autocomplete but keep filtering function. at the moment it automatically completes the textbox when there are several matched options for the entered text. i hope a function that will filter out the unmatched options from the list and provide the matched items as options on the dropdown list rather than force the textbox to accept one which probably is not the user’s desired one.

many thanks.

You may try to use enableFIlteringMode(true,url,false) in order to disable caching.
However, there are no reasons for described problem. If the problem isn’t solved, please provide the sample to recreate the problem.

I have this same issue and it occurs if the user deletes the entry or uses their backspace key and starts typing again. each keystroke produces a duplicate entry in the list

I have this same issue
Make sure that you did not define the 4th parameter in the enableFIlteringMode method and server-size script doesn’t return xml with add=“true” attribute in the complete tag.