2

右揃えにしたいコンポーネントがありますが、少しだけ元に戻したいのですが...

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'
    }],
    ...

「->」を何に変更しますか?

4

3 に答える 3

1

最善の方法 (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'
            }]
        }]
    });
});
于 2012-05-03T23:56:27.010 に答える
1

または、ボックスを追加することもできます:

{
   xtype: 'box',
   width: 20
}
于 2012-05-03T23:06:42.433 に答える
1

そのための特定の構成はありませんが、ツールバー項目の後にスペーサーを追加して、右側から離すことができます。'->','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 に相当するかはわかりませんが、お分かりいただけると思います。

于 2012-05-03T22:45:12.790 に答える