2014-04-17 63 views
3

我正在使用Extjs 4.2,以下是我的一段代码。分页工具栏与面板的左侧对齐。我想让InfoButton对齐面板的右侧。我想要分页栏和与分页工具栏在同一行上的按钮完全左对齐,并且InfoButton完全右对齐。现在,分页工具栏完全左对齐,但InfoButton像中心对齐,我试着做边缘对齐和填充对齐。但它仍然是一样的。如果我在这里丢失了某些东西,或者我应该怎么做才能对齐按钮,有人可以帮助我吗?将extjs dockeditems中的按钮与左侧的pagingtoolbar右对齐

this.dockedItems = [ 
     { 
      xtype: 'pagingtoolbar', 
      itemId: 'FirstToolbar', 
      dock:'bottom', 
      store: Store, 
      displayInfo: true, 
      displayMsg: 'Displaying info {0} - {1} of {2}', 
      emptyMsg: "No info to display", 
      items: [ 
       { 
        xtype: 'container', 
        flex: 1 
       }, '->', 
       { 
     xtype: 'button',       
        cls:'InfoButton', 
     itemId: 'InfoButton',      
        dock:'bottom', 
       }, '->' 
      ] 
     } 
    ]; 

回答

0

您需要定义在同一水平pagingtoolbar按钮:

this.bbar = [ 
    { 
     xtype: 'pagingtoolbar', 
     itemId: 'FirstToolbar', 
     store: Store, 
     displayInfo: true, 
     displayMsg: 'Displaying info {0} - {1} of {2}', 
     emptyMsg: "No info to display" 
    }, '->', 
    { 
     xtype: 'button',       
     cls:'InfoButton', 
     itemId: 'InfoButton', 
     text: 'sample' 
    } 
]; 
+0

嗨,感谢您的建议,尝试过,但网页本身不会打开。认为它不会以这种方式添加与pagingtoolbar相同级别的按钮。有些东西丢失了,或者我可能是错的,你能不能让我知道是否有其他方式,或者你的代码中缺少什么。 – user3546785

+0

确定我错过了2件事:你需要在'bbar'(= bottombar)中定义所有内容,并且你忘记为按钮设置文本 –

+0

我尝试使用bbar,但它缩小了我的结果集网格大小,它看起来非常紧凑现在,所以这可能不适用于这个问题。有什么其他的想法吗?... – user3546785

相关问题