我想把文本从“是”改为“是!!!”从“不”到“不!!!”我尝试了很多东西,但似乎都没用。找不到有关Sencha的任何文档,如果有人能帮上忙,谢谢
Ext.application({
name: 'Fiddle',
launch: function() {
Ext.Msg.confirm('Confirmation', "Do you want to cancel the order?", function(btnText){
//btnText = {
// yes: "YES!!",
// no: "NO!!"
//},
//btnText.setText("YESSS!!"),
if(btnText === "yes"){
Ext.Msg.alert("Alert", "You have cancelled the order.");
}
else if(btnText === "no"){
Ext.Msg.alert("Alert", "You have confirmed 'No'.");
}
}, this);
}
});
[解决方案]
Ext.application({
name: 'Fiddle',
launch: function() {
Ext.Msg.show({
title: 'Title',
message: 'Message',
buttons: {
yes: 'Cancel preAuth',
no: 'Cancel the whole order',
cancel: 'Do nothing!'
},
fn: function(buttonValue, inputText, showConfig) {
if(buttonValue === "yes"){
Ext.Msg.alert("Alert", "You have cancelled the order.");
}
else if(buttonValue === "no"){
Ext.Msg.alert("Alert", "You have confirmed 'No'.");
}
}, this);
}
});
1条答案
按热度按时间vx6bjr1n1#
使用
Ext.Msg.show
而不是e1d1e,并为自定义按钮文本设置buttonText
。检查文档并尝试以下代码: