Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Adam Downs on Jun 23, 2009 05:44
open dhtmlx forum
Combo grouping Issue

I am using 2 combo boxes on a form, They load the options from xml from DB and I set one as a child to the other... I need to initialize each and show the current values... I have tried every combination I can think of and I am able to set the Value OR the text of the child but no matter what I do the form posts the child with XXX_new_value = true...

If I use setComboText the text is right but the value is blank. If I use setComboValue the value is right but the Text is wrong... The last method seams to clear the previous... My Combo has Integers as Values and Text as the text.

How can I set the child option and have the combo box realize this was a previously available option... Is there a way to find an Index of a value or text as well?

Regards,

Answer posted by Alex (support) on Jun 23, 2009 06:47

xxx_new_value means that the combo value is not presented in option list .

Possibly you call this method before xml loading (when there are no options in combo).

If you tries to implement some complicated functionality, you use onChange event instead of groups extension:

 parentCombo.attachEvent("onChange",function(){
  childCombo.loadXML(path_to_script+"?parent="+parentCombo.getActualValue(),doAfterLoading)
}); 

function doAfterLoading(){

childCombo.setComboValue(value);

}