先上代码,注意文中的红色字体

   
   
   
   
  1. var form = new Ext.form.FormPanel({ 
  2.                 autoHeight : true
  3.                 id : 'reformId'
  4.                 frame:true
  5.                 width : 400, 
  6.                 border: false
  7.                 height:300, 
  8.                 labelWidth:60, 
  9.                 items: [{ 
  10.                     layout:'column'
  11.                     border:false
  12.                     items: [{ 
  13.                         layout:'form'
  14.                         border:false
  15.                         columnWidth:.7, //在这里写columnWidth,注意位置
  16.                         items:[{ 
  17.                         xtype : 'textfield'
  18.                         fieldLabel: '学校名称'
  19.                         id:'_ent_name'
  20.                         readOnly:true
  21.                         anchor:'100%', //在这里写anchor
  22.                         name:'entName'
  23.                         allowBlank:false 
  24.                         }] 
  25.                     },{layout:'form'
  26.                         border:false
  27.                         columnWidth:.3, 
  28.                         items:[{ 
  29.                         xtype:'button'
  30.                         text:'选择学校'
  31.                         name:'choiceEnt'
  32.                         anchor:'50%'
  33.                         listeners :{ 
  34.                             click :function(){ 
  35.                                 choiceTarget(); 
  36.                             } 
  37.                         } 
  38.                         }] 
  39.                     }]} 
  40.                     ,{ 
  41.                     layout:'column',items:[{ 
  42.                     layout:'form'
  43.                     border:false
  44.                     items:[accountGrid] 
  45.                     },{ 
  46.                         layout:'form'
  47.                         border:false
  48.                         items:[{ 
  49.                         xtype:'textarea'
  50.                         columnWidth:1, 
  51.                         fieldLabel:'备注'
  52.                         msgTarget : 'under'
  53.                         width:300, 
  54.                         height:80, 
  55.                         name:'note'
  56.                         emptyText:'请填写相关备注信息'}] 
  57.                     } 
  58.                 ] 
  59.                 }] 
  60.             }); 

看到了吧,如果一行中同一列有多个对象,就要用到columnWidth和anchor了,大家要注意它俩的位置,否则是出不了效果的。