I m developing a form using ext-js. I hve added buttons. by clicking the save button it shows msg asking for the confirmation having 2 buttons ok and save. But i m nt getting how to give different message for these two different buttons. Here is my开发者_如何学编程 code
buttons: [
{
text: 'Save',
handler:function()
{
Ext.Msg.show({
title:'Confirmation',
msg: 'Press OK if u want to Contine otherwise Press Cancel to Exit',
buttons: Ext.Msg.OKCANCEL
//There are buttons added
});
}
},
}]
instead of an ext.Msg.show you can create a messagebox component and configure it as you want.
var messageBox = new Ext.MessageBox({
buttonText: {
ok : 'other Ok',
cancel: 'other cancel'
}
});
and then show the component
messageBox.show({
title:'Confirmation',
msg: 'Press OK if u want to Contine otherwise Press Cancel to Exit',
buttons: Ext.Msg.OKCANCEL
//There are buttons added
});
Note that the buttons id's will still be ok and cancel..
精彩评论