Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Imran Khan on Nov 11, 2008 02:51
open dhtmlx forum
combo options should be visible on arrow click after filtering.

I am using dhtml combo and using the following code:

var combo=new dhtmlXCombo("combo_zone2","alfa2",200);
combo.enableFilteringMode(true);
combo.addOption([['1','Imran'],['2','Abbasi'],['33','Ajmal'],['44','Rashid'],['5','Khan']]);

When I click on the combo arrow after filtering then all other options are disappeared from the combo list.
I want, all the options to be there after the filtering.
Answer posted by Support on Nov 11, 2008 04:47

can be done, by adding next code to the combo's init

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

Answer posted by Imran Khan on Nov 11, 2008 07:13
I have used your code. But after using your code, when I click on the combo then it goes to the infinite loop. What is this problem?
Answer posted by Support on Nov 11, 2008 09:52
Please, try to set timeout like as follows:

combo.attachEvent("onOpen",function(){
    window.setTimeout(function(){
        var text = combo.getComboText();
        combo.setComboText("");
        combo.filterSelf();
        combo.setComboText(text);
    },1);
}
Answer posted by Imran Khan on Nov 11, 2008 21:57
When I used this then my combo gets disappear and two java script errors arises:

t is undefined
for (var q=0; q<t.getElementsByTagName("control").length; q++) {
editor2.js (line 21)
missing ) after argument list
function onKeyPressedFunc(key)\n


Answer posted by Imran Khan on Nov 12, 2008 23:33
I got a mail from dhtmlx but my answer of my question was not there.
Answer posted by Support on Nov 13, 2008 06:18
Working sample attached
Attachments (1)
Answer posted on Nov 13, 2008 23:35
Hi,

Thanks for the sample. Its working but not 100% as we desired. Please find the attached image. Basically its like when we type it would filter and autocomplete but all items in the list should be shown. Is that possible?

Best regards
Attachments (1)
Answer posted by Support on Nov 14, 2008 02:15
Unfortunately there is no way to use combo in such mode. 
Answer posted by sirisha on Jan 27, 2009 01:27

Everything works fine,but when selecting the combo using tab complete text gets highlighted and on press any alphabet in keyborad,only

the second time of pressing the same alphabet autocomplete starts working. Pressing only once clears the text and the typed alphabet is not there.

HOw to overcome this.

Plz help me. its very urgent.

Answer posted by Support on Jan 27, 2009 02:53
There is no way to achieve fully correct behavior through existing events, but it possible with usage of native DOM events.
Please check updated sample. 
Attachments (1)
3849234.ZIP18.61 Kb
Answer posted by sirisha on Jan 27, 2009 20:38

thanku so much..its working for me now.

Thanks a lot.