使用ExtJS如何指定'-&燃气轮机';负一点点?
我有一个组件,我想对齐的权利,但想把它带回只是一点点使用ExtJS如何指定'-&燃气轮机';负一点点?,extjs,Extjs,我有一个组件,我想对齐的权利,但想把它带回只是一点点 me.dockedItems = [ { xtype: 'toolbar', dock: 'top', items: [{ text: i18n.user_new, disabled: false, action: 'add', iconCls: 'icon-user-add' }, '->', // is there
me.dockedItems = [ {
xtype: 'toolbar',
dock: 'top',
items:
[{
text: i18n.user_new,
disabled: false,
action: 'add',
iconCls: 'icon-user-add'
},
'->', // is there a way to say align right minus 20px?
{
fieldLabel: i18n.filter,
labelWidth: 40,
xtype: 'filterfield'
}],
...
我应该将“->”更改为什么?没有特定的配置,但您可以在工具栏项后添加空格,将其从右侧推离,例如:
'->,“yourOwnConfig',”,“,”
换句话说,“
相当于工具栏上的一个小空间,您可以将更多的工具栏并排添加到右侧所需的空间中
或者用你的例子:
me.dockedItems = [ {
xtype: 'toolbar',
dock: 'top',
items:
[{
text: i18n.user_new,
disabled: false,
action: 'add',
iconCls: 'icon-user-add'
},
'->', // is there a way to say align right minus 20px?
{
fieldLabel: i18n.filter,
labelWidth: 40,
xtype: 'filterfield'
},' ',' ',' ',' '],
我不知道其中有多少相当于20px,但我想你明白了。或者你可以添加框:
{
xtype: 'box',
width: 20
}
最好的方法(IMO)是指定保证金:
Ext.onReady(function() {
var form = Ext.create('Ext.panel.Panel', {
width: 400,
height: 400,
renderTo: document.body,
dockedItems : [{
xtype: 'toolbar',
items: [{
text: 'B1'
}, '->', {
text: 'B2',
margin: '0 20 0 0'
}]
}]
});
});
感谢@Geronimo的快速回复。我已经做了类似的事情,但只向items数组添加了一个额外的元素<代码>项:[MyButtonNonLeft',->',myComponentOnRight',]可能还有更好的答案,但这将暂时起作用。添加容器似乎有点过分,因为边距与Evan示例中的精度相同