沉睡森林@漂在北京

          本處文章除注明“轉載”外均為原創,轉載請注明出處。

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            152 隨筆 :: 4 文章 :: 114 評論 :: 0 Trackbacks

          在利用viewport進行布局處理的時候出現了問題,情況是頁面顯示不合理。具體的代碼如下:

          var _bodyWidth = Ext.getBody().getWidth()-12;

          function testForm1(){

          }

          Ext.onReady(function(){

                 Ext.QuickTips.init();

                 Ext.form.Field.prototype.msgTarget = 'title';

                

                 var panel_cnorth = new Ext.Panel({name:'panel_cnorth',frame:false, region:'north',layout:'fit',id:"panel_cnorth",split:true});

                 var testForm_north = new Ext.FormPanel({name:'testForm_north',id:'testForm_north',layout:'table',width:_bodyWidth+12,layoutConfig: {columns:4},defaults:{border:false,layout:'form',frame:false,labelAlign:'right',labelWidth:75,width:_bodyWidth/2,height:30}, method:'post',url:'txn990051.do',title:'north表單',frame:true});

                 testForm_north.addButton({text:'test form',handler:testForm1});

                 testForm_north.addButton({text:'重置',handler:function(){resetForm('testForm_north')}});

                 testForm_north.add({colspan:2,width:_bodyWidth/2.0,items:{xtype:'textfield',fieldLabel:'用戶名',allowBlank:false,disabled:true,blankText:'用戶名不能為空!',emptyText:'enter your username',id:'username1',name:'username1',anchor:"100%"}});

                 testForm_north.add({colspan:2,width:_bodyWidth/2.0,items:{xtype:'textfield',fieldLabel:'電子郵箱',readOnly:true,value:'bingxue2332@163.com',id:'msn2',name:'msn2',anchor:"100%"}});

                 testForm_north.add({colspan:2,width:_bodyWidth/2.0,items:{xtype:'textfield',fieldLabel:'QQ號碼',maxLength:9.0,maxLengthText:'QQ號碼長度不能超過9位!',minLength:5.0,minLengthText:'QQ號碼長度不能少于5位!',id:'qq3',name:'qq3',anchor:"100%"}});

                 testForm_north.add({colspan:2,width:_bodyWidth/2.0,items:{xtype:'textfield',fieldLabel:'MSN號碼',value:'msn',id:'email4',name:'email4',vtype:'email',anchor:"100%"}});

                 panel_cnorth.add(testForm_north);

                

                 var panel_center = new Ext.Panel({name:'panel_center',frame:false,height:200,region:'center',id:"panel_center"});

                 var testForm = new Ext.FormPanel({name:'testForm',id:'testForm',layout:'table',style:'height:100%',width:_bodyWidth+12,layoutConfig: {columns:4},defaults:{border:false,layout:'form',frame:false,labelAlign:'right',labelWidth:75,width:_bodyWidth/2,height:30}, method:'post',url:'txn990051.do',title:'center',frame:true});

                 testForm.addButton({text:'test form',handler:testForm1});

                 testForm.addButton({text:'重置',handler:function(){resetForm('testForm')}});

                 testForm.add({colspan:2,width:_bodyWidth/2.0,items:{xtype:'textfield',fieldLabel:'用戶名',allowBlank:false,disabled:true,blankText:'用戶名不能為空!',emptyText:'enter your username',id:'username',name:'username',anchor:"100%"}});

                 testForm.add({colspan:2,width:_bodyWidth/2.0,items:{xtype:'textfield',fieldLabel:'電子郵箱',readOnly:true,value:'bingxue2332@163.com',id:'msn',name:'msn',anchor:"100%"}});

                 testForm.add({colspan:2,width:_bodyWidth/2.0,items:{xtype:'textfield',fieldLabel:'QQ號碼',maxLength:9.0,maxLengthText:'QQ號碼長度不能超過9位!',minLength:5.0,minLengthText:'QQ號碼長度不能少于5位!',id:'qq',name:'qq',anchor:"100%"}});

                 testForm.add({colspan:2,width:_bodyWidth/2.0,items:{xtype:'textfield',fieldLabel:'MSN號碼',value:'msn',id:'email',name:'email',vtype:'email',anchor:"100%"}});

                 panel_center.add(testForm);

                       

                 var viewport1 = new Ext.Viewport({name:'viewport1',id:'viewport1',layout:'border',items:[panel_center,panel_cnorth]});

           

          });

           

           

          posted on 2008-11-17 17:22 王總兵 閱讀(181) 評論(0)  編輯  收藏 所屬分類: Ext
          主站蜘蛛池模板: 安义县| 红桥区| 武汉市| 屏东县| 成都市| 玛曲县| 莫力| 永和县| 兰考县| 历史| 齐齐哈尔市| 四子王旗| 花莲县| 台湾省| 彰化市| 富川| 金沙县| 泉州市| 巢湖市| 共和县| 宁陵县| 安图县| 腾冲县| 鄱阳县| 兰州市| 兴和县| 阳西县| 政和县| 建始县| 岫岩| 台北市| 佛教| 柘荣县| 万全县| 淮北市| 婺源县| 邳州市| 庄河市| 河东区| 航空| 马关县|