EXT table layout example (I personally think the most suitable layout method currently)

Source: Internet
Author: User

 

I studied the ext layout over the weekend and found that the previous things were troublesome. Now it seems very simple. The use of ext is not particularly difficult, but how can we ensure that ext can meet various abnormal page requirements while preventing developers from getting in touch with a bunch of JS? This is definitely a problem.

Or clickCode. The following code uses the table mode to layout formpanel. The label cannot be displayed in non-form mode, but there are still problems. For example, generally, "Start Date" and "End Date" only occupy one column, that is, two elements each occupy half of the column.

 

This is the main code,Source codeIt is reproduced on the Internet.

 

<SCRIPT type = "text/JavaScript"> function getbodywidth () {return document. body. clientWidth-15;} function func_submit_onclick () {alert ('hello');} VaR _ bodywidth = getbodywidth (); // VaR _ bodywidth = 900; VaR _ columns = 3*2; vaR _ perwidth = _ bodywidth/_ columns; Ext. onready (function () {Ext. quicktips. init (); var tableform = new Ext. formpanel ({Name: 'tableform', ID: 'tableform', frame: True, // width: _ bodywidth + 30, layout: 'table', style: 'height: 100% ', // bodystyle: 'padding: 8px 0 0 0;', // top-right-bottom-left layoutconfig: {columns: _ columns}, title: 'tableform', ults: {border: false, bodystyle: 'padding: 8px 0 0 0; ', layout: 'form', frame: false, labelalign: 'right ', labelwidth: 75, width: _ perwidth * 2, height: 30}); tableform. add ({colspan: 2, items: {xtype: 'textfield ', fieldlabel: 'First name', anchor: '000000'}); tableform. add ({colspan: 2, items: {xtype: 'textfield ', fieldlabel: 'First name', anchor: '000000'}); tableform. add ({colspan: 2, items: {xtype: 'textfield ', fieldlabel: 'First name', anchor: '000000'}); tableform. add ({colspan: 1, width: _ perwidth, items: {xtype: 'datefield ', fieldlabel: 'First name', anchor: '000000'}); tableform. add ({colspan: 1, width: _ perwidth, labelalign: 'center', items: {xtype: 'datefield ', fieldlabel: 'to', anchor: '000000'}); tableform. add ({colspan: 2, items: {xtype: 'textfield ', fieldlabel: 'First name', anchor: '000000'}); tableform. add ({colspan: 2, items: {xtype: 'textfield ', fieldlabel: 'First name', anchor: '000000'}); tableform. add ({colspan: 2, items: {xtype: 'den den ', fieldlabel: 'First name', anchor: '000000'}); // hide a column, used for blank column layout tableform. add ({colspan: 4, width: _ perwidth * 4, items: {xtype: 'textfield ', fieldlabel: 'First name', anchor: '200 '}}); tableform. addbutton ({text: 'submit ', Handler: func_submit_onclick}); tableform. addbutton ({text: 'cancel'}); tableform. render (ext. getbody () ;}); </SCRIPT>

 

I want to extend the display to three interfaces: 1: full-screen display of rows and columns; 2: Display of rows and columns in a local area; 3: Display of rows and columns nested in other containers (such as Windows;

Method 1

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.