Search code examples
dhtmlx

Load table data using json in dhtmlxform


How to load table formed json data in DHTMLXForm.? i am trying using the method loadStruct but its not working kindly advise on this..... This is a sample if i can load this means i can load the data from db.

Json is 
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"}] 
         }];

Solution

  • Use the following to create a new form:

    myForm = new dhtmlXForm("form_container", data);
    

    Or for an existing form:

    myForm.loadStruct(data, "json", function(){
       // onload handler
    });