Following MessageBox Examples, but different result

January 6th, 2009
  • Hi all, I'm hoping this is just something simple I have overlooked. I am trying to attach a MessageBox to an Ext.Action as such:

    var actionCancel = new Ext.Action({
    text: 'Cancel',
    handler: function(){
    Ext.MessageBox.confirm('Please Confirm','Are you sure you want to Cancel and lose all changes?',
    function(btn){
    alert(btn); //This alerts "1" always
    if(btn == 'yes'){
    //do yes event
    }
    }
    );
    }
    });
    However I'm finding at the alert within the message box function always alerts the value "1" no matter which option is selected (yes or no). I even copy/pasted the code again directly from the Ext example, and I get the same result (when it is inside my action).

    Is that not the correct way of approaching this?

    Thanks for any help you can provide!


  • Maybe put the Ext stuff in its own name space?


  • And what you said has me thinking now... I'm working on pulling out this Ext I am using into a separate page; I'm wondering if something is conflicting with the button?

    This would be weird, though. It's the first Action I've added into the page, the rest of the Ext is just simple panels and a toolbar.


  • i get yes or no.

    What Browser are you using?


  • Have you used firebug before?


  • wouldn't know where to start - it's your page ;)


  • Yes I've used firebug. I was trying it under Firefox 3.


  • I just pulled the action out alone, and it seems to work fine as you suggested.

    So the only thing left is that it must be something in my page conflicting with the button? Any ideas on where to start (:


  • I'd prefer not to claim ownership over it :)

    We have some custom JS as well as CSS, I can try and start commenting out some stuff until it seems to behave properly.

    So much for being simple :s







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Following MessageBox Examples, but different result , Please add it free.