ext.js Messagebox按钮对齐方式

时间:2013-10-25 19:16:50

标签: javascript extjs

在Ext.js ext-4.2.1中是否有办法在Ext.MessageBox中左对齐两个按钮?

从(有效)开始:

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

“按钮:”的文档显然是错误的,并且不显示按钮,位于“ok:'Foo ...”(下方)。

可以使用“按钮”来指定几个按钮的ID,名称和其他属性,如果是,那么什么是工作示例?

“buttons Object / Boolean按钮配置对象(例如,Ext.MessageBox.OKCANCEL或{ok:'Foo',取消:'Bar'}), “

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

1 个答案:

答案 0 :(得分: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'}]);

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

相关问题