Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Emilie Meunier on Apr 16, 2009 11:44
open dhtmlx forum
empty list of combo box

Hi,

I have a combo box with the options created dynamically by data from the database with filtering enabled.
The first time that I click on the combo box I saw the list but after selecting or typing an item of the list when a click again on the drop down list, nothing appears. The list is empty... I have to erase the text and typing again but I don't want to do that. I want to be able to see the list when I click on it.

Try your sample: http://dhtmlx.com/docs/products/docsExplorer/index.shtml?node=dhtmlxcombo&type=smpl and you will see the problem.

Is there a workaround?

Thank you,

Emilie
Answer posted by Alex on Apr 17, 2009 01:55

Hello, 

In case of filtering enableFilteringMode(true) (but if you don't use autocomplete mode - enableFilteringMode(true,url)), you can use apply the following method:

combo.attachEvent("onOpen",function(){
 
 window.setTimeout(function(){
  var index = combo.getSelectedIndex();
  var text = combo.getComboText();
  combo.setComboText("");
  combo.filterSelf();
  combo.setComboText(text);
 ,1);
 
 return true;
});

In case of using autocomplete these is no opportunity to show the whole list.