开发者

Displaying different message on button click of Ext-js Form

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..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜