kendoWindow appendTo boundaries

11 posts, 0 answers
  1. Emanuele Zambrano
    Emanuele Zambrano avatar
    21 posts
    Member since:
    Dec 2009

    Posted 03 Dec 2012 Link to this post

    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 ?
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 05 Dec 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Emanuele Zambrano
    Emanuele Zambrano avatar
    21 posts
    Member since:
    Dec 2009

    Posted 05 Dec 2012 Link to this post

    I had already read your documentation.

    My question is, how can I get similar behavior ?
  5. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 10 Dec 2012 Link to this post

    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!
  6. Aditya
    Aditya avatar
    5 posts
    Member since:
    Feb 2013

    Posted 26 Feb 2013 Link to this post

    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...
  7. Emanuele Zambrano
    Emanuele Zambrano avatar
    21 posts
    Member since:
    Dec 2009

    Posted 26 Feb 2013 Link to this post

    I migrate all my windows to jquery-ui.
  8. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 28 Feb 2013 Link to this post

    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!
  9. Aditya
    Aditya avatar
    5 posts
    Member since:
    Feb 2013

    Posted 28 Feb 2013 Link to this post

    Petur Subev,

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

    Cheers..
    Aditya Velala
  10. Angelo
    Angelo avatar
    32 posts
    Member since:
    Nov 2011

    Posted 28 Feb 2013 Link to this post

    I second that this workaround worked with no problems for me.

    Vote for this functionality, please!
  11. UFIS
    UFIS avatar
    15 posts
    Member since:
    Oct 2013

    Posted 02 Jul 2014 in reply to Angelo Link to this post

    Hi Petur and Aditya,

    Do you have any sample for this functionality ?


  12. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 03 Jul 2014 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready