EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: azmiahmad on November 28, 2014, 07:42:26 AM



Title: dialog/window not displayed in center in 1.4.1
Post by: azmiahmad on November 28, 2014, 07:42:26 AM
I tried upgrading from 1.3.6 to 1.4.1. After upgrade new dialog and window are opened at random locations on screen. They always used to open in center until version 1.3.6. Looking at the source I figured a workaround to call method 'center' on load.
Code:
$('#dialog').dialog('center');
But this is not scalable as I am using dialog at 100+ places. Is there a way to ensure that all dialog/window open in center of screen by default. This is a blocker for me and I can't upgrade.

Please help !!


Title: Re: dialog/window not displayed in center in 1.4.1
Post by: ehussain on January 16, 2015, 01:06:52 PM
use this

$.extend($.fn.dialog.methods, {
    mymove: function(jq, newposition){
        return jq.each(function(){
            $(this).dialog('move', newposition);
        });
    }
});


$(dialogName).dialog('move', {
   left: 10,
   top: 200
});
         
$(dialogName).dialog('open').dialog('setTitle','abcd Details');