当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - ExtJS--How to center align two toolbar buttons

问题描述:

I have a grid panel with a bottom toolbar:

this.bbar = [

"->",

{

text:"<font color = white><b>Save</b></font>", itemId:"save",

},

"<-",

{

tooltip:"Back to Home Screen", itemId:"backhome", text:"<b>&lt; back</b>"

}

];

the right arrow -> moves the save button all the way to the right. So I thought adding a left arrow <- would center the two buttons that did not work. Both buttons are pushed to the right and the left arrow can be seen so i dont think "<-" is valid.

Is there another approach i can take to center my two buttons?

thanks..

网友答案:

Append layout config to your toolbar.

layout: {
    pack: 'center',
    type: 'hbox'
}

Documentation (http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.layout.container.Box-cfg-pack)

分享给朋友:
您可能感兴趣的文章:
随机阅读: