The extended fieldset is as follows:
CopyCode The Code is as follows: Me. Base. fieldset = ext. Extend (ext. Form. fieldset ,{
Layout: 'column ',
Fieldsetitems: [],
Autoscroll: false,
Defaults :{
Layout: 'form ',
Labelalign: 'right ',
Labelwidth: 65,
Columnwidth:. 25,
Defaults :{
Anchor: '000000'
}
},
Initcomponent: function (){
VaR thisitems = new array ();
VaR itemslen = This. fieldsetitems. length;
If (itemslen> 0 ){
For (VAR I = 0; I <itemslen; I ++ ){
Thisitems [thisitems. Length] = {
Items: This. fieldsetitems [I]
}
}
}
This. Items = thisitems;
Me. Base. fieldset. superclass. initcomponent. Call (this );
}
});
copy the Code the code is as follows: new me. base. fieldset ({
title: 'Basic information',
autoheight: True,
fieldsetitems: [{
xtype: 'textfield ',
fieldlabel: "User Name",
name: 'user _ name'
},{
xtype: 'textfield ',
inputtype: 'Password',
fieldlabel: "User Password",
name: 'Password'
},{
xtype: 'textfield ',
fieldlabel: "mobile phone number",
name: 'mobile'
},{
xtype: 'textfield ',
fieldlabel: "Mobile Phone Number",
name: 'sss'
},{
xtype: 'textfield ',
fieldlabel: "mobile phone number ",
name: 'Eee '
}]
In this way, each component can be fixed in width and automatically extended as the number of items increases to ensure uniformity.
however, the display result always shows a border, and the container wrapped outside each component has a border, which is very ugly.
Add
xtype: 'Container',
autoel :{},
to each container configuration item in column mode: copy Code the code is as follows: me. base. fieldset = ext. extend (ext. form. fieldset, {
layout: 'column',
fieldsetitems: [],
autoscroll: false,
defaults: {
xtype: 'Container',
autoel :{},
layout: 'form',
labelalign: 'right',
labelwidth: 65,
columnwidth :. 25,
defaults: {
anchor: '000000'
}< BR >},
initcomponent: function () {
var thisitems = new array ();
var itemslen = This. fieldsetitems. length;
If (itemslen> 0) {
for (VAR I = 0; I thisitems [thisitems. length] = {
items: This. fieldsetitems [I]
}< BR >}< br> This. items = thisitems;
me. base. fieldset. superclass. initcomponent. call (this);
}< BR >});