I am using ExtJS 3.4, I have a fieldset mainDetailsFieldSet which I want to use in two forms, addFormPanel and updateFormPanel. I am able to get the fieldset in addFormPanel form, but I am not able to get it in updateFormPanel..I am getting a single blue line. I am not able to find what is wrong here...can someone help me with this?
Here is my code:
//mainfieldset with a textfield and combobox
var clCombo = new Ext.form.ComboBox({
store: store,
fieldLabel: 'Name',
displayField: 'clName',
name: 'clName',
valueField: 'clName',
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText: 'Select Here'
});
this.mainDetailsFieldSet = new Ext.form.FieldSet({
title: 'Details',
items:[
{
fieldLabel: ' Name',
xtype: 'textfield',
name: 'name'
},clCombo
]
});
var mainDetailsFieldSet = this.mainDetailsFieldSet ;
//addFormPanel, where I am using mainfieldset
this.addFormPanel = new Ext.form.FormPanel({
title: 'Add Form',
autoScroll: true,
items:[
mainDetailsFieldSet ]
});
//updateformpanel, where I want to add the same field set again
this.updateFormPanel = new Ext.form.FormPanel({
autoScroll: true,
items:[mainDetailsFieldSet]
});
Thanks in advance
You cannot render one instance at to different places.
Variant A: You will need to create a second instance if you need it twice.
Variant B: But what you can do is remove and add the instance each time.
Note Use configurations with
xtype's as often as you can and don't define anyidby yourself if it is not strictly needed.Variant C: