2013-06-24 7 views
0

동일한보기에서 양식과 격자를 모두 연결해야하지만이 작업을 수행 할 수 없습니다 ... 어떻게 확장 할 수 있습니까?동일한보기에서 격자 및 양식

Ext.grid.Panel

Ext.form.Panel

내보기 코드가 같은입니다 ...

Ext.define('CustomerService.view.customer.AfterAddingTemplate',{ 
extend:'Ext.grid.Panel', 
alias:'widget.aftertemplate', 
requires:['Ext.form.Panel','Ext.grid.Panel'], 
id:'afteraddingtemplate', 
store:'StockCategoryStore', 
autoResizeColumns:true, 
//layout:'fit', 
columnLines:true, 
stripeRows:true, 
autoHeight:true, 
autoWidth:true, 
initComponent:function(){ 
this.items=[{ 
xtype:'textfield', 
fieldLabel:'something' 
}]; 
this.columns=[ 
{ 
header:'Select a template', 
flex:2 
}, 
{header:'Category'}, 
{header:'Warehouse'}]; 
this.callParent(arguments);  
}}); 

답변

1

왜 이렇게 둘 다 확장해야합니까? 양식을 확장하고 항목으로 gridpanel을 추가하면됩니다.

Ext.define('MyApp.view.MyForm', { 
    extend: 'Ext.form.Panel', 
    height: 250, 
    width: 400, 
    bodyPadding: 10, 
    title: 'My Form', 
    initComponent: function() { 
     var me = this; 
     Ext.applyIf(me, { 
      items: [ 
       { 
        xtype: 'textfield', 
        anchor: '100%', 
        fieldLabel: 'Label' 
       }, 
       { 
        xtype: 'gridpanel', 
        title: 'My Grid Panel', 
        columns: [ 
         { 
          xtype: 'gridcolumn', 
          dataIndex: 'string', 
          text: 'String' 
         } 
        ] 
       } 
      ] 
     }); 
     me.callParent(arguments); 
    } 

}); 
관련 문제