0
votes

I have a simple grid and when I click on a record a custom window shows up, then if I click on Open-Pop-Up button I want the confirm pop-up to show up right on top of the custom window. I'm using

customePanel.showAt(event.pageX, event.pageY); 

to show the custom window on top of the record that was clicked on based on the X and Y axis, and I'm trying to use the same functionality to show the confirm pop-up but I'm not having any luck.

Here's a working code: FIDDLE

 handler: function () {
         var x = Ext.MessageBox.confirm(
         'Confirm', 'Are you sure you want to see patient\'s chart?', callbackFunction);
            function callbackFunction(btn) {
              var self = this;
              if(btn === 'yes') {
               Ext.Msg.alert ('Redirecting', 'You will be redirected soon...');
               } else {
                self.close();
        }
    };
 }

Any ideas on what I'm missing or need to do? Thank you in advance!

1
The default behaviour of message box is to center in the document body. You would need to write your own positioning code. However, what do you mean by "right on top"? The MsgBox is a different size to your custom window.Evan Trimboli
@EvanTrimboli When I say right on top I mean having the Confirm Pop-Up over the Custom Window (Like on top of it - kind of like in the center of Custom window)HenryDev

1 Answers

1
votes

Use this:

Ext.MessageBox.confirm('Confirm', 'Foo', callbackFunction);
Ext.MessageBox.alignTo(customePanel, 'c-c');