Development Environment ExtJS4.07Ext. onReady (function () {Ext. define (& amp; #39; Ext. form. closableFieldSet & amp; #39;, {extend: & amp; #39; Ext. form. fieldSet & amp; #39;, alias: & amp; #39; widget. clo Development Environment ExtJS 4.07
Ext. onReady (function (){
Ext. define ('ext. form. ClosableFieldSet ',{
Extend: 'ext. form. FieldSet ',
Alias: 'widget. closablefieldset ',
// Override the parent class Method
InitLegend: function (){
Var me = this;
Me. callParent (arguments );
If (! Me. legend. closable ){
Me. legend. insert (1, Ext. widget ('tool ',{
Type: 'close ',
Handler: me. onCloseClick,
Scope: me
}));
Me. legend. closable = true;
}
},
OnCloseClick: function (){
If (this. ownerCt ){
This. ownerCt. remove (this, true );
}
}
});
Ext. create ('ext. form. Panel ',{
Title: 'closable fieldset ',
BodyPadding: 10,
Width: 550,
RenderTo: Ext. getBody (),
Items :[
{
Xtype: 'closablefieldset ',
ColumnWidth: 0.5,
Title: 'test ',
Collapsible: true,
DefaultType: 'textfield ',
Ults: {anchor: '20140901 '},
Layout: 'anchor ',
Items :[
{
FieldLabel: 'field 1 ',
Name: 'field1'
},
{
FieldLabel: 'field 2 ',
Name: 'field2'
}
]
}
]
});
});
From zdkjob