1

Is there a way in Ext.js ext-4.2.1, to left-align two buttons in an Ext.MessageBox?

Starting with (which works):

Ext.MessageBox.show({ title:'AA', 
    msg: 'BB',
    prompt: true,
    buttonText: {ok:'Proceed', cancel:'STET'},
    fn: function (btn, groupName) {...}
});

The documentation of "buttons:" is clearly wrong and does not display buttons, at "ok:'Foo..." (below).

Can "buttons" be used to specify id, name, and other properties of several buttons, and if so, what is a working example?

" buttons Object/Boolean A button config object (e.g., Ext.MessageBox.OKCANCEL or {ok:'Foo', cancel:'Bar'}), "

source: http://dev.sencha.com/playpen/docs/output/Ext.MessageBox.html

4

1 回答 1

1

您可以通过在对话框中添加自定义按钮来实现您想要的:

Ext.MessageBox.show({ title:'AA', 
   msg: 'BB',
   prompt: true,
   fn: function (btn, groupName) {console.log("fn called");}
}).add([{xtype: 'button', text: 'button1'}, {xtype: 'button', text: 'button2'}]);

从那里,你可以对按钮做任何你想做的事情。我在这个例子中省略了处理程序,但这应该给你一个起点。

于 2013-10-25T20:23:59.507 回答