Interface adjustment for ExtJsform interface display (browser compatibility)

Source: Internet
Author: User
The ExtJS interface is not very nice, but its compatibility is good. The following describes the compatibility of the browser caused by ExtJS programming. Code of the element in formPanel of ExtJS in formPanel of formPanel in IE under Firefox: Java code/* port **/defPortFieldnew... SyntaxHi

 

The ExtJS interface is not very nice, but its compatibility is good. The following describes the compatibility of the browser caused by ExtJS programming.

 

FormPanel interface under Firefox

 

FormPanel interface under IE

 

Code of the element in ExtJS formPanel:

Java code

/* Port **/

DefPortField = new Ext. form. NumberField ({

FieldLabel: 'ftp port ',

Width: 160,

LabelSeparator :'',

Id: 'fportfield ',

AllowBlank: false,

AllowNegative: false,

AllowDecimals: false

});

 

FtpUserField = new Ext. form. TextField ({

DefaultType: 'textfield ',

Width: 160,

LabelSeparator :'',

Id: 'ftpuserfield ',

FieldLabel: 'user ',

AllowBlank: false

});

 

FtpUserPassField = new Ext. form. TextField ({

DefaultType: 'textfield ',

Width: 160,

LabelSeparator :'',

Id: 'ftpuserpassfield ',

FieldLabel: 'Password ',

AllowBlank: false

});

FtpRootPathField = new Ext. form. TextField ({

DefaultType: 'textfield ',

Width: 160,

LabelSeparator :'',

Id: 'ftprootpathfield ',

FieldLabel: 'ftp root directory ',

AllowBlank: false,

Regex:/^ \/[^ \] * $ /,

RegexText: 'incorrect root directory format'

});

 

 

Problem code

Java code

Var ftpServSetForm = new Ext. FormPanel ({

Width: 330,

Frame: true,

Layout: 'column ',

Items :[{

ColumnWidth:. 99,

Xtype: 'fieldset ',

LabelWidth: 140,

DefaultType: 'textfield ',

AutoHeight: true,

Border: false,

Items: [ftpHostField]

},{

ColumnWidth:. 99,

Xtype: 'fieldset ',

LabelWidth: 140,

DefaultType: 'textfield ',

AutoHeight: true,

Border: false,

Items: [defPortField]

},{

ColumnWidth:. 99,

Xtype: 'fieldset ',

LabelWidth: 140,

DefaultType: 'textfield ',

AutoHeight: true,

Border: false,

Items: [ftpUserField]

},{

ColumnWidth:. 99,

Xtype: 'fieldset ',

LabelWidth: 140,

DefaultType: 'textfield ',

AutoHeight: true,

Border: false,

Items: [ftpUserPassField]

},{

ColumnWidth:. 99,

Xtype: 'fieldset ',

LabelWidth: 140,

DefaultType: 'textfield ',

AutoHeight: true,

Border: false,

Items: [ftpRootPathField]

}]

});

 

 

Correctly displayed code

Java code

Var ftpServSetForm = new Ext. form. FormPanel ({

Id: 'tool _ ftpservsetform ',

Width: 330,

Layout: 'column ',

Frame: true,

Items :[{

ColumnWidth:. 99,

Xtype: 'fieldset ',

LabelWidth: 140,

DefaultType: 'textfield ',

AutoHeight: true,

Border: false,

Items: [ftpHostField, defPortField, ftpUserField,

FtpUserPassField, ftpRootPathField]

}]

});

 

 

Analysis: In the problem Code, every form is separated into a "fieldSet", which is equivalent to five "fieldSet". It is displayed in IE as far apart, it is easy to confuse the distance during layout.

Firefox does not have this type of problem, and the layout is normal.

 

The correct solution should be to put each field in a "fieldSet" so that all browsers can browse normally.

 

Summary: this is only a small problem that people with good programming habits will not encounter. To solve this problem, I can stop making the same mistake when writing code in the future. This is progress.

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.