EasyUI Forum
September 13, 2025, 11:55:00 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Confirmation Message Box Position  (Read 12722 times)
elcidofauy
Newbie
*
Posts: 11


View Profile
« on: October 04, 2014, 11:56:04 PM »

Dear All,

This one is driving me a little insane as positioning items is simple in most cases...

My problem relates to the confirmation message box which is always centered relative to the height of the page i.e. content length and not to the actual screen size (actual height of the screen). Therefore if the page is really long the message box is always shown at the bottom of the screen ...

In simple terms why is it not possible to simply apply position attributes to the confirmation (and prompt) messager boxes as with the other message box type... I note that this property does not exist for this type as per documentation... I've also tried to fix this using stylesheet attributes but to no avail...

Here is a partial code example:


$.messager.confirm('Confirm','Are you sure you want to remove this xxxx?',function(r){
      if (r){
             //Do something 
      }
});


I'm basically trying to add the below (a rough example whilst looking online):

function popupwindow(url, title, w, h) {
  var left = (screen.width/2)-(w/2);
  var top = (screen.height/2)-(h/2);
  return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}



What can I add to this to position the confirmation box relative to the screen? Can it be done using stylesheets? Appreciate any help/guidance on how to solve this!!!  Huh Huh Huh

Many Thanks in Advance...



Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 05, 2014, 04:50:26 AM »

Calling the $.messager.confirm function can return the confirm message window object. You can call 'move' method to move this window to the new position you want.
Code:
var win = $.messager.confirm('My Title', 'Are you confirm this?', function(r){
if (r){
alert('confirmed: '+r);
}
});
win.window('move',{
left:100,
top:100
})
Logged
elcidofauy
Newbie
*
Posts: 11


View Profile
« Reply #2 on: October 05, 2014, 05:41:12 AM »

Dear Stworthy, Yes indeed that worked like a charm!!! Thank you so much for getting back on this so quickly... Awesome....  Smiley  Grin
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!