2014-09-11 41 views

回答

3

嘗試this..this是相當多按按我的理解您的要求。

Ext.define('My.test.Viewport', { 
extend: 'Ext.container.Viewport', 

requires: [ 
    'Ext.layout.container.Border', 
    'Ext.layout.container.HBox', 
    'Ext.toolbar.Toolbar', 
    'Ext.toolbar.TextItem', 
    'Ext.toolbar.Fill' 
], 
autoScroll: true, 
items:[ 
     { 
       layout: 'hbox', 
       items: [ 
        { 
         xtype : 'toolbar', 
         itemId: 'searchToolbar', 
         items : [ 
           { 
            xtype: 'tbtext', 
            text: 'Item1' 
           } 
         ] 
        }, 
        { 
        xtype: 'tbfill' 
        } 
        ,{ 
         xtype: 'toolbar', 
         items: [ 
          { 
             xtype: 'tbtext', 
             text: 'Item2' 
           } 

         ] 
        } 
       ] 
      } 

] 

}); 

Ext.create('My.test.Viewport'); 
+0

你是絕對正確的,thx) – 2014-09-11 13:59:11

1

是否有任何限制,那阻止你使用CSS?如果不是的話,你不能添加itemCls到一個類的左邊和右邊的配置?

items: [{ 
    xtype: 'toolbar', 
    itemCls: 'toolbar-dock-left', 
    ... 
}, { 
    xtype: 'toolbar', 
    itemCls: 'toolbar-dock-right', 
    ... 
} 
+1

如果你提供了CSS來完成這個,會是更好的答案。 – mvd 2017-06-12 22:32:10

相關問題