I'm I'm using ExtJS to create a formPanel dynamyc from database (string result from server to object extjs)
Ext.Ajax.request({
async : false,
method : 'POST',
url : '/Devt/GetFormItemCustomization',
params : {
TableName : 'tabeltest',
col : 1
},
success : function (response) {
var results = Ext.decode(response.responseText);
console.log(results );
var form = Ext.create('Ext.form.Panel', {
width : 300,
bodyPadding : 10,
renderTo : 'formCustDiv',
name : "test",
items : [results]
});
}
})
this response from server:
{
fieldLabel:'Employee Id',
xtype:'textfield',
allowBlank:false,
},
{
fieldLabel:'Nick Name',
xtype:'textfield',
allowBlank: false,
}
but this only create one object from last data. Object
{
fieldLabel: "Nick Name",
xtype: "textfield",
allowBlank: false
}
i want response from server decode become two object:
Object {fieldLabel: "Employee Id", xtype: "textfield", allowBlank: false}
Object {fieldLabel: "Nick Name", xtype: "textfield", allowBlank: false}
Any suggests?