Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 27, 2008 05:46
open dhtmlx forum
Hi team,                   ...

Hi team,

                       wow... Its working fine.. Thanks for your reply.

In that I have one question, that is in my code :

z1= new dhtmlXCombo("objCombo1","name",200);
z2= new dhtmlXCombo("objCombo2","surname,200);
z3= new dhtmlXCombo("objCombo","id",200);

z1.enableFilteringMode(true);
z2.enableFilteringMode(true);
z3.enableFilteringMode(true);   
z1.attachEvent("onKeyPressed",nameCombo_onKeyPressed);
}


function nameCombo_onKeyPressed(){
    var value=z1.getActualValue();
    z2.clearAll();
    z2.loadXML("../common/jsp/sample1.jsp");
    z3.clearAll();
    z3.loadXML("../common/jsp/sample2.jsp");
}




Here i got the data list for z2 and z3 when i type some text in z1 and press "enter" key then only the onKeyPress event is called... But i need to call this at every character i typed in z1 combo. I mean whenever I type a character in the z1 combo, the operation mentioned in the onKeyPressed function should be performed. How can i achieve this.? Please guide me

Thanks in Advance

Regards,
Ashok
   
Answer posted by Support on Mar 27, 2008 07:03
onKeyPressed event handler has to be called every time you press any key inside combo's input.

But getActualValue() method returns only value of selected  option.  So before you don't really select the option  (press enter key), actual value will stay the same.

If you want to get the printed text as a "value", you can use getComboText() method

function nameCombo_onKeyPressed(){

    var value=z1.getComboText();
  ...
}


Answer posted on Mar 27, 2008 21:44
onKeyPressed event handler is called only at the time of pressing "Enter" Key.I need to call this event handler when i enter any character in the z1 combo.
Now I press any character other than  keyascii "13"(Enter) and "27", it will not be called.

Answer posted by Support on Mar 28, 2008 03:53
The problem was not reconstructed locally. Please, see attached sample.

If problem persists, please, provide any sample where it can be reconstructed  (to support@dhtmlx.com )
Attachments (1)
Answer posted on Mar 31, 2008 02:20
Yes... Now its working fine..Because I have the old version of dhtmlxCombo. that why i can't called the event handler for the "onKeyPressed". After I update the latest version, now its working fine.

Thanks to support team.

Regards,
Ashok