gpt4 book ai didi

带有自定义按钮的 ExtJs 消息框

转载 作者:行者123 更新时间:2023-12-03 13:28:32 25 4
gpt4 key购买 nike

如何使用自定义按钮显示 ExtJS 消息框。

我想要一个带有自定义消息和“取消”和“停用”按钮的消息框。
请给出一些想法。

buttons: [{
text: "Cancel",
handler: function () {
Ext.MessageBox.hide();
//submitTicketForm();
}
},{
text: "Deactivate",
handler: function () {
Ext.MessageBox.hide();
}
}],

我像这样使用它,但没有得到任何按钮。

最佳答案

在 ExtJS 4 中,您可以像这样制作自己的组件:

Ext.define('App.view.MyDialog', {
/**
* Shows the dialog.
*/
show: function() {
var dialog = Ext.create('Ext.window.MessageBox', {
buttons: [{
text: 'baz',
iconCls: 'icon-add',
handler: function() {
dialog.close();
}
}]
});

dialog.show({
title: 'foo!',
msg: '<p>bar?</p>',
icon: Ext.MessageBox.WARNING
});

dialog.setHeight(160);
dialog.setWidth(420);
}
});

然后:
var dialog = Ext.create('App.view.MyDialog');
dialog.show();

关于带有自定义按钮的 ExtJs 消息框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6261013/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com