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

kendoWindow appendTo boundaries

10 Answers 806 Views
Window
This is a migrated thread and some comments may be shown as answers.
Emanuele
Top achievements
Rank 2
Emanuele asked on 03 Dec 2012, 11:00 AM
I create a KendoWindow with appendTo set to a specific div.

the expected behavior is:

1) moving window inside parent boundaries
2) maximize windows inside parent boundaries

How can I obtain this behavior ?

10 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 05 Dec 2012, 09:15 AM
Hello Emanuele,

The behavior you experience is working as expected.

As explicitly mentioned in the documentation "this does not constrain the window dragging within the given elemen".

http://docs.kendoui.com/api/web/window#appendto objectstringdefault

Kind regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Emanuele
Top achievements
Rank 2
answered on 05 Dec 2012, 09:20 AM
I had already read your documentation.

My question is, how can I get similar behavior ?
0
Petur Subev
Telerik team
answered on 10 Dec 2012, 09:57 AM
Hello Emanuele,

Since the functionality is not supported out-of-the-box I would suggest you to share such idea on our Kendo User Voice page.
Depending how many people will vote for this functionality we will consider adding it sooner to the suite.

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Aditya
Top achievements
Rank 1
answered on 26 Feb 2013, 04:43 PM
Hello Emanuele,

are you able to fix this. i would like to have similar kind of feature... if you are able to fix it...can you please share the guide lines....how to fix it.

Petur Subev,
can you please share some guidelines which helps me to implement on my own

Thanks in advance...
0
Emanuele
Top achievements
Rank 2
answered on 26 Feb 2013, 05:32 PM
I migrate all my windows to jquery-ui.
0
Petur Subev
Telerik team
answered on 28 Feb 2013, 08:31 AM
Hello Aditya,

A possible work-around to limit the dragging of the Window out of coordinates (900x600 in the example below) could be the following:


 
<script type="text/javascript">
    $(document).ready(function () {
        $("#windowName").data("kendoWindow").dragging._draggable.bind("drag", function (e) {
 
            var wnd = $("#window").data("kendoWindow");
            var position = wnd.wrapper.position();
 
            var minT = 0;
            var minL = 0;
            //Get the Window width and height and
            //place them in position of the hard-coded width and height
            var maxT = 600 - wnd.wrapper.height();
            var maxL = 900 - wnd.wrapper.width();
 
            if (position.left < minL) {
                coordinates = { left: minL };
                $(wnd.wrapper).css(coordinates);
            }
 
            if (position.top < minT) {
                coordinates = { top: minT };
                $(wnd.wrapper).css(coordinates);
            }
 
            if (position.left > maxL) {
                coordinates = { left: maxL };
                $(wnd.wrapper).css(coordinates);
            }
 
            if (position.top > maxT) {
                coordinates = { top: maxT };
                $(wnd.wrapper).css(coordinates);
            }
        })
    })
</script>


You can use this as a base point and extend it with more complex logic.

Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Aditya
Top achievements
Rank 1
answered on 28 Feb 2013, 04:05 PM
Petur Subev,

Thanks alot...... it worked & am able to extend this functionality. 

Cheers..
Aditya Velala
0
Mike
Top achievements
Rank 1
answered on 28 Feb 2013, 06:31 PM
I second that this workaround worked with no problems for me.

Vote for this functionality, please!
0
UFIS
Top achievements
Rank 1
answered on 03 Jul 2014, 01:39 AM
Hi Petur and Aditya,

Do you have any sample for this functionality ?


0
Petur Subev
Telerik team
answered on 03 Jul 2014, 07:06 AM
Hello Emanuele,

There is the same example copy/pasted into our Dojo site:

http://trykendoui.telerik.com/@pesho/IgaJ

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Window
Asked by
Emanuele
Top achievements
Rank 2
Answers by
Petur Subev
Telerik team
Emanuele
Top achievements
Rank 2
Aditya
Top achievements
Rank 1
Mike
Top achievements
Rank 1
UFIS
Top achievements
Rank 1
Share this question
or