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

Window: get position, set position

2 Answers 291 Views
Window
This is a migrated thread and some comments may be shown as answers.
Joonas
Top achievements
Rank 1
Joonas asked on 10 Apr 2013, 10:08 AM
Hello

I'm using KendoUI with ASP.NET. Setting the position of a KendoUI window element is relatively easy, but I'm finding it difficult to get position(top, left) dynamically.

Can it be done? If window is moved from its original position to other, can I somehow read the new coordinates. The information has to be somewhere because positions are know when a window is closed and opened again.

Cheers,
JoonasK

2 Answers, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 10 Apr 2013, 01:07 PM
Hello Joonas,


You could retrieve the windows wrapper position with the offset() method. It returns an object, containing the top and left offsets of the element.

E.g.
var win = $("#window").data("kendoWindow");
var position = win.wrapper.offset();

 

All the best,
Dimiter Madjarov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joonas
Top achievements
Rank 1
answered on 11 Apr 2013, 06:40 AM
Alright. I actually tried this before, but did obviously something wrong.

Thank you very much for your help! 
Tags
Window
Asked by
Joonas
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Joonas
Top achievements
Rank 1
Share this question
or