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.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745247887a4618497.html
评论列表(0条)