2

Can't load options into dhtmlxCombo. I try the following:

myForm = new dhtmlXForm("dhtmlxForm"); 
myForm.loadStruct("codebase/form.xml"); 
var combo = myForm.getCombo("xVolumeStatus");
combo.load("codebase/options.xml");
combo.selectOption(2, false, true);

But combo is undefined

1 Answers1

5

You forget callback. Twice  It must be:

myForm.attachEvent("onXLE", function() {
    var combo = myForm.getCombo("xVolumeStatus");
    combo.load("codebase/options.xml", function(){
        combo.selectOption(2, false, true);
    });
});

First you getting combo when form is loaded, then you select option when combo options are loaded.

V.Ol
  • 283
  • 1
  • 7