admin管理员组文章数量:1416051
I have an ExtJs form which upon receiving a response from server shows a pop-up based on whether the submit was successful or not. The code looks like this:
if (form.isValid()) {
form.submit({
success: function (form, action) {
Ext.Msg.alert('Success', action.result.msg);
},
failure: function (form, action) {
Ext.MessageBox.show({
title:'Failure',
msg: action.result.msg,
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
}
});
}
Now, rather than having an alert message for the success, I'd like to also have a Message box with a 'check' icon. It doesn't look like it is available in ExtJS in the same way as Ext.MessageBox.ERROR, so I was wondering how I can create a custom icon to appear there?
I have an ExtJs form which upon receiving a response from server shows a pop-up based on whether the submit was successful or not. The code looks like this:
if (form.isValid()) {
form.submit({
success: function (form, action) {
Ext.Msg.alert('Success', action.result.msg);
},
failure: function (form, action) {
Ext.MessageBox.show({
title:'Failure',
msg: action.result.msg,
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
}
});
}
Now, rather than having an alert message for the success, I'd like to also have a Message box with a 'check' icon. It doesn't look like it is available in ExtJS in the same way as Ext.MessageBox.ERROR, so I was wondering how I can create a custom icon to appear there?
Share Improve this question edited Mar 22, 2019 at 15:56 DJDaveMark 2,86526 silver badges38 bronze badges asked Nov 9, 2012 at 15:53 Art FArt F 4,21210 gold badges52 silver badges84 bronze badges1 Answer
Reset to default 5The icon config option is just a CSS class, define a new one like:
.check-icon {
background-image: url(../img/check.png');
background-repeat: no-repeat;
}
Then in config:
icon: 'check-icon'
Should do what you want.
本文标签: javascriptExtJs create custon icon for ExtMessageBoxStack Overflow
版权声明:本文标题:javascript - ExtJs create custon icon for Ext.MessageBox - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745247886a2649642.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论