2012-02-01 52 views
1

如何使基於窗口大小的extjs中的gridpanel/table自動擴展? 感謝 我加布局:「適合」。我沒有太大變化Extjs表格/網格自動擴展爲全部

var listView = Ext.create('Ext.grid.Panel', { 
    store: mystore, 
    multiSelect: true, 
title:'Notifications for ' + jsonServiceId + ' <i>(0 items selected)</i>', 
    viewConfig: { 
     emptyText: 'No images to display' 
    }, 
    //reserveScrollOffset: true, 
renderTo: containerEl, 
     layout:'fit', 

    columns: [{ 
     text: 'Sell', 
     flex: 10, 
     dataIndex: 'Sell', 
     renderer: function(value, metaData, record) { 
     // alert(record.get('Sell')); 


    } 
    },{ 
     text: 'Class', 
     flex: 10, 
     dataIndex: 'ClassName' 
    }, 


    { 
     text: 'Last Changed', 
     flex: 20, 
     dataIndex: 'LastChangedAt', 
    xtype: 'datecolumn', 
     format: 'd-M-Y h:i a' 
    } 
]  
}); 
+0

這是否幫助? http://stackoverflow.com/questions/2366211/is-there-any-way-to-get-an-extjs-gridpanel-to-automatically-resize-its-width-bu – artlung 2012-02-01 23:36:54

+1

@artlung工作!謝謝 :) – user244394 2012-02-02 20:27:32

回答