2016-11-09 16 views
0

が、私はこのようなウィンドウのグリッドを作成しています:ウィンドウ迷惑な水平スクロールバーでExtJSの4 gridpanel

このようなウィンドウ生成している
Ext.create('Ext.data.Store', { 
    storeId:'simpsonsStore', 
    fields:['name', 'email',], 
    data:{'items':[ 
     { 'name': 'Lisa', "email":"[email protected]" }, 
     { 'name': 'Bart', "email":"[email protected]" }, 
     { 'name': 'Homer', "email":"[email protected]" }, 
     { 'name': 'Marge', "email":"[email protected]" } 
    ]}, 
    proxy: { 
     type: 'memory', 
     reader: { 
      type: 'json', 
      root: 'items' 
     } 
    } 
}); 

Ext.create("Ext.window.Window", { 
title: 'BlaBla', 
closable: true, 
modal: true, 
width: 800, 
height: 460, 
layout: 'fit', 
items: [ 
    { 
     xtype: 'gridpanel', 
     autoScroll: true, 
     store: Ext.data.StoreManager.lookup('simpsonsStore'), 
     title: 'Choose which features you would like to use to create parts.', 
     // height: 300, 
     columns: { 
      items: [ 
       { 
        header: 'Name', 
        tooltip: 'Name', 
        dataIndex: 'name', 
        flex: 1 
       }, 
       { 
        header: 'Email', 
        tooltip: 'Email', 
        dataIndex: 'email', 
        flex: 1 
       } 
      ] 
     } 
    }, 

] 
}).show(); 

window with grid

をしかし、gridpanelは迷惑を持っています水平スクロールバーです。これは、列が収まるため必要ではありません。

なぜスクロールバーが作成され、代わりに使用する必要がありますか?

+0

私はフィドルでコードを実行すると、スクロールバーが表示されません。 @UDID:幅を変更しなくても、うまく見えます。 – Srikanth

+0

@Srikanthかもしれませんが、私がフィドルを作成するとスクロールバーが表示されるので、これはウィンドウ幅のために起こると仮定します。ウィンドウが実際のグリッドよりも小さい場合、これは一般的に起こります。 – UDID

答えて

1

このスクロールバーは、ウィンドウの幅と高さのために作成されます。グリッドのためではありません。あなたはウィンドウの幅を調整してください、あなたは欲望の結果を得るでしょう。私は窓のwidthを変えて完全に来ます。ここにあなたのfiddle

0

高さ&をウィンドウに割り当てて、グリッドパネルに与えないでください。 このウィンドウのために、自動高さ&の幅は、単にグリッドに依存します。 ;)

関連する問題