2017-03-29 17 views
0

我需要将水平滚动设置为ExtJS tbar,其中包含一行中不可见的按钮。以下是代码。extjs 4 - 在网格面板中将水平滚动设置为tbar

Ext.define('myProject.view.accounts.user.UserGrid', { 
    extend: 'Ext.grid.Panel', 
    alias: 'widget.usergrid', 
    minHeight: 400, 
    margin: '0,5,0,5', 
    title: 'User Accounts', 
    region: 'center', 
    cls: 'grid-with-footer', 
    scroll: 'vertical',   
    bind: { 
     ... 
    }, 
    initComponent: function() { 
     ... 
     Ext.applyIf(me, { 
      columns: [{ 
       ... 
      }], 

      features: [{ 
       ... 
      }], 

      tbar: [{ // <-- this should be horizontally scrollable. 
       ... 
      }], 

      bbar: { 
       ... 
      } 
     }); 
     this.callParent(); 
    } 
}); 

(我用的ExtJS 4.2.1)

+1

请给些为你的问题提供解决] – Tejas

回答

1

而不是使用TBAR的,可以将其添加为dockedItem,这使得更多的CONFIGS

dockedItems: [{ 
     xtype: 'toolbar', 
     dock: 'top', 
     overflowX: 'scroll', // <---- This allows horizontal scroll 
     items: [ 
      ..... 
     ] 
    }] 

您可以查看这在小提琴here

(编辑:小提琴是不是4.2 ExtJS的6.2,哎呦)