Window extension to perform action on open and on close for all windows

6 posts, 1 answers
  1. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 30 Sep 2014 Link to this post

    I would like to always perform some action on open of a Window and then also at close of a Window.  Instead of repeating the code for every Window, I would like to have an extension I can use to do this for me.  Is this possible and how would I go about this?

    Specifically, I want to do this when the window opens:
        $('body').css('overflow', 'hidden');

    and this when the window closes:
        $('body').css('overflow', 'visible');

    Thanks,
    --Ed
  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 02 Oct 2014 Link to this post

    Hello Ed,

    You can use the open and close events of the Kendo UI Window, to run custom code when the widget is opened/closed. You can check the following documentation article:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/window#events-open

    and 

    http://docs.telerik.com/kendo-ui/api/javascript/ui/window#events-close

    Regards,
    Kiril Nikolov
    Telerik
     
    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. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 02 Oct 2014 in reply to Kiril Nikolov Link to this post

    Hi Kiril,

    Yes, I am using those events now, but for the sake of consistency across the application, I was hoping there was a way I could force this behavior for all Kendo Windows that are opened - and not have to repeat myself over and over again for each Window that I configure.

    Thanks,
    --Ed
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 03 Oct 2014 Link to this post

    Hi Ed,

    Then you can modify the Kendo UI source code, and make the windows appear the way it is needed in your application. Please note that customizing the Kendo UI scripts is out of scope for the standard support services and we will not be able to assist you on the matter.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  6. Ed
    Ed avatar
    168 posts
    Member since:
    Sep 2013

    Posted 03 Oct 2014 in reply to Kiril Nikolov Link to this post

    Hi Kiril,

    Isn't there a way for me to extend the current kendo window object (let's call it kendoWindowEd) where I could define this behavior as the default?  This way, I would avoid mucking with the kendo source code and hopefully, won't break compatibility when a new version comes out.

    Is this possible and if so, can you point me in the right direction?

    Thanks,
    --Ed
  7. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2564 posts

    Posted 06 Oct 2014 Link to this post

    Hi Ed,

    You might find this information helpful:

    http://blogs.telerik.com/kendoui/posts/12-04-03/creating_custom_kendo_ui_plugins

    and:

    http://stackoverflow.com/questions/9313618/how-do-you-extend-kendo-ui-widgets

    I hope this information will help you get started.

    Regards,
    Kiril Nikolov
    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