1 Ext.Msg.alert
Ext.Msg.alert("标题1",'结果1');
2 Ext.Msg.confirm
Ext.Msg.confirm("标题2","结果2",function(btn) {
//btn指代所点击的按钮,yes或no
if(btn == 'yes') {
console.log("我点了yes");
} else if(btn == 'no') {
console.log("我点了no");
}
});
3 Ext.Msg.OK 和Ext.Msg.ERROR的用法
Ext.Msg.show({
title: "标题1",
msg: "内容1",
buttons: Ext.Msg.OK, //指 确认按钮
icon: Ext.Msg.INFO // 感叹号标识
});
Ext.Msg.show({
title: '标题2',
msg: "内容2",
buttons: Ext.Msg.OK, // 指 确认按钮
icon: Ext.Msg.ERROR // 错误标识
});
4 Ext.Msg.prompt用法
Ext.Msg.prompt("标题","内容",function(btn,text) {
//btn 按钮id ok或cancel
//text 输入的内容
if(btn == 'ok') {
console.log("yes " + text);
} else if(btn == 'cancel') {
console.log("no " + text);
}
});
