Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Swapnil Deshmukh on Mar 11, 2009 07:26
open dhtmlx forum
Combobox filter problem

Dear Sir,

I am using dhtmlCombo in my project, its a dynamic one, I have also used the filter there, but whenever I select the option the all option is disappear from the drop down, I would like to have all the option in drop down list after it got filtered.
Please refer the below code I have used in

<div id="part_zone" style="width:375px; height:30px;"></div>
<script>
        var cont_combo="";
        var part_combo=new dhtmlXCombo("part_zone","part",375);
        //part_combo.enableFilteringMode(true,"XML/allParts.jsp",true,true);
        part_combo.enableFilteringMode(true);
        part_combo.loadXML("XML/allParts.jsp")
        part_combo.attachEvent("onChange",onChangeFunc);
</script>
Answer posted by Alex (support) on Mar 11, 2009 08:19

Hello,

Something similar to the next can be used:

var part_combo=new dhtmlXCombo("part_zone","part",375);  
part_combo.enableFilteringMode(true);
part_combo.loadXML("XML/allParts.jsp")
part_combo.attachEvent("onChange",onChangeFunc);


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