DHTMLX Docs & Samples Explorer

loadStruct(data,onLoadFunction)

Loads XML into dhtmlxForm instance.

Parameters:

  • data - the http path to an XML file
  • onLoadFunction - (optional) a user defined handler which is called when loading has been done
myForm.loadStruct("file.xml", function(){
  // onload handler
});

Description:

  • The method can be always used to load a local json object into form. In this case the method takes 3 parameters:

    var data = [
                 { type: "fieldset", name: "data", label: "Welcome", inputWidth: "auto", list:[
    	               {type:"input", name: 'name', label:'Login'},
    	               {type:"password", name:"pass", label:"Password"},
    	               {type:"button", name:"save", value:"Proceed"}] 
    	     }
    ];
     
    myForm.loadStruct(data, "json", function(){
      // onload handler
    });

See also: