开发者

Displaying different message on button click of Ext-js Form

开发者 https://www.devze.com 2023-04-10 18:17 出处:网络
I m developing a form using ext-js. I hve addedbuttons. 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 mess

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

精彩评论

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

关注公众号