This is a migrated thread and some comments may be shown as answers.

Non modal Window initial position

1 Answer 103 Views
Window
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 20 Oct 2014, 04:17 PM
How do I set the initial position of the Window to be centred?

I have hooked up a click event on a button which calls the following JavaScript:

function clickViewJobLogImage()
{
    var win = $("#viewJobLogWindow").data("kendoWindow");
 
    win.title("Testing 123");
    win.refresh();
    win.center();
    win.open();
}

But if the user then drags the window to a new position and then clicks the button to open the window (in effect refresh it) then it jumps back to the centre!

Ideally I want the window to open initially centered but if the user has moved it to open in it's last position on subsequent calls to open it.

1 Answer, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 22 Oct 2014, 07:54 AM
Hello Mark,

This functionality is not supported at this time. You can set a flag on the window in the dragEnd event, (this.moved = true), and check it before centering (if (!win.moved) win.center(); )

Regards,
Alex Gyoshev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Window
Asked by
Mark
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or