2012-07-18 34 views
1

在内线分页工具栏有没有办法居中显示消息ExtJS的pagingtoolbar如何中心显示消息

  xtype: 'pagingtoolbar', 
      height: 26, 
      width: 360, 
      displayInfo: true, 
      displayMsg: '{0} - {1} of {2}', 
      border: false, 
      store: 'myStore' 
      dock: 'bottom' 

我想中心的displayMsg,但我还没有怎么样。

回答

1

默认情况下,当displayInfo为true时,分页工具栏将添加一个tbfill元素。要将文字居中,您可以在最后添加另一个tbfill。

grid.down('pagingtoolbar').add({xtype:'tbfill'}); 

这将在居中工具栏的空白部分的文字,如果你想中心它整个的工具栏,我认为你需要计算第一tbfill的宽度,然后设置进去。