The 'column' column layout of FieldSet in ExtJS

Source: Internet
Author: User

The extended FieldSet is as follows:

Copy to ClipboardReference: [www.bkjia.com] 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 to ClipboardReference: [www.bkjia.com] 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: 'ss'
},{
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 of each component package has a border, which is very ugly.

In fact, it is added to each container configuration item in column mode.

Xtype: 'Container ',
AutoEl :{},

You can:

Copy to ClipboardReference: [www.bkjia.com] 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'
}
},
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 );
}
});

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.