Hello.
I need to create element by js.
I have config like this:
scheduler.config.form = [
{view: ‘richselect’, name: ‘’, labelWidth:130, label: ‘Program Type’, id: ‘programTypeSelect’, datatype: ‘json’,url:‘timeline.ota?getTypeProgram’},
{view: ‘richselect’, name: ‘’, label: ‘Program’, id: ‘programSelect’, datatype: ‘json’,url:‘timeline.ota?getProgram’},
{view: ‘richselect’,name: ‘’, label: ‘Units’, id: ‘unitSelect’, datatype: ‘json’},
{view: ‘richselect’, name: ‘’, label: ‘Workload’, id: ‘workloadSelect’, datatype: ‘json’},
{type:“clean”,id:“hourSection”, cols:[
{view:“counter”, id:“hoursLength”,css:“hoursLength”,on:{“onAfterRender”:checkVisibleOt}, label: scheduler.locale.labels.label_hours, step: 1, valueWidth: “auto”, value: 0, min: 0, max: 24, labelWidth: 100, labelPosition: “left”, labelAlign: “left”},
{view:“counter”, id:“hoursLengthPt”,on:{“onAfterRender”:checkVisiblePt}, label: scheduler.locale.labels.label_hoursPt, step: 1, valueWidth: “auto”, value: 0, min: 0, max: 24, labelWidth: 100, labelPosition: “left”, labelAlign: “left”},
]
},
{view:"text", labelWidth:100, id:'text', label:scheduler.locale.labels.label_event, name:'text'},
{view:"datetext", id:'start_date', css:"hideDate", label:scheduler.locale.labels.label_start, name:'start_date', dateFormat:scheduler.config.form_date},
{view:"datetext", id:'end_date', css:"hideDate", label:scheduler.locale.labels.label_end, name:'end_date', dateFormat:scheduler.config.form_date},
{view:"toggle", on:{"onAfterRender":function(){this.hide();}}, id:'allDay', label:"", align: "right", value:"0", options: [
{value:"0",label:scheduler.locale.labels.label_time},
{value:"1",label:scheduler.locale.labels.label_allday}
]},
{view:"rectext", on:{"onAfterRender":function(){this.hide();}}, id:'rec_type', label:scheduler.locale.labels.recurring.repeat, readonly:true},
{view:"textarea", id:'details', label:labels.label_details, name:'details', height:150},
{view:"input", id:'event_length', type:"hidden"},
{view:"input", id:'eventType', type:"hidden"}
];
And in this place
{type:“clean”,id:“hourSection”, cols:[
{view:“counter”, id:“hoursLength”,css:“hoursLength”,on:{“onAfterRender”:checkVisibleOt}, label: scheduler.locale.labels.label_hours, step: 1, valueWidth: “auto”, value: 0, min: 0, max: 24, labelWidth: 100, labelPosition: “left”, labelAlign: “left”},
{view:“counter”, id:“hoursLengthPt”,on:{“onAfterRender”:checkVisiblePt}, label: scheduler.locale.labels.label_hoursPt, step: 1, valueWidth: “auto”, value: 0, min: 0, max: 24, labelWidth: 100, labelPosition: “left”, labelAlign: “left”},
]
},
I want to create new elements (text fields and labels) by javascript dynamicly.
Please help me.
P.S. Sorry for my english