Extjsでのcolumnwidthとanchorの使用


まずコードをつけて、文の中の赤いフォントに注意します
   
   
   
   
  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を使います.両方の位置に注意してください.そうしないと効果が出ません.