2012-01-26 12 views
4

私はグリッドパネルのみを含むページを作成しています。私は、グリッドパネルにブラウザのサイズに基づいてスクロールバーを持たせたいと思います。これを行うには、hereのようにビューポートにラップして、hereのようにレイアウトを指定していることを確認してください。グリッドはうまく描画されますが、スクロールバーが表示されません。私は 'フィット'、 'ボーダー'と 'アンカー'のレイアウトを試しましたが、まだ運がありません。extjs gridpanelがスクロールバーを表示しない

Ext.create('Ext.Viewport', { 
    items: [{ 
     region: 'center', 
     layout: 'fit', 
     xtype: 'gridpanel', 
     store: myStore, 
     loadMask: true,  
     columns: [{ 
      header: 'Account ID', 
      dataIndex: 'acct_id', 
      width: 70 
     }, { 
      header: 'First Name', 
      dataIndex: 'first_name', 
      width: 120 
     }, { 
      header: 'Last Name', 
      dataIndex: 'last_name', 
      width: 120 
     }, { 
      xtype: 'numbercolumn', 
      header: 'Account Balance', 
      dataIndex: 'acct_bal', 
      width: 70, 
      renderer: Ext.util.Format.usMoney 
     }, { 
      xtype: 'numbercolumn', 
      header: 'Credit', 
      dataIndex: 'credit', 
      width: 70, 
      renderer: Ext.util.Format.usMoney 
     }, { 
      xtype: 'numbercolumn', 
      header: 'Debt', 
      dataIndex: 'debt_bal', 
      width: 70, 
      renderer: Ext.util.Format.usMoney 
     }], 
    }] 
}); 

答えて

9

あなたはViewportfitレイアウトを設定する必要があります:コードは次のようになりますGridPanelにレイアウトを設定する

Ext.create('Ext.Viewport', { 
    layout: 'fit', 
    items: [...] 
}); 

効果がありません。

+0

うわー、ありがとう。明らかに私はSenchaのポストで何かを逃した。 – Geronimo

関連する問題