2017-01-16 15 views
1

我有一個Panel,並且在該面板中我動態地加載網格。 這是代碼面板滾動條位置在佈局上是錯誤的:fit

{ 
    xtype: 'panel', 
    region: 'center', 
    frame: true, 
    scrollable: true, 
    itemId: 'MyGrid', 
    reference: 'MyGrid', 
    layout: { 
     type: 'vbox', 
     align: 'stretch' 
    }, 
    items: [] 
} 

和網格的示例。

Ext.define("MyApp.view.MYGrid", { 
extend: 'Ext.grid.Panel', 
    alias: 'widget.MyGrid', 
    requires: [ 
     'Ext.grid.filters.Filters', 
     'Ext.form.field.ComboBox', 
    ], 
    emptyText: 'No data available.', 
    disableSelection: true, 
    margin: '3 3 0 3', 
    collapsible: true, 
    multiSelect: false, 
    closable: true, 
    columnLines: true, 
    uniqueFields: [], 
    }); 

initComponent: function() { 
    var me = this; 
    me.fields = me.prepareFields(me.headersXmlDoc); 
    me.columns = me.prepareColumns(me.headersXmlDoc); 
    me.store = me.prepareGridStore(me.headersXmlDoc); 
    this.callParent(arguments); 
}, 

現在,當電網有足夠的數據,那麼這兩個horizental和垂直滾動正確到來,但是當電網有更多列滾動條下來的數據量。我認爲這只是最後一個記錄,但它正在下降。

儘管記錄數較少,但所有網格都採用相同的高度。

例PIC https://i.stack.imgur.com/RKdTb.png

我要略低於過去的數據滾動條。通過調試我發現layout : fit 但不知道如何克服這一點。

任何人都可以幫助我。感謝幫助。

回答

1

你需要申請overflowY爲真正的grid.I不認爲有適合佈局的問題。如果上面的配置不工作共享一些小提琴。