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

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

5 Answers 111 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 30 Sep 2014, 05:00 PM
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

5 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 02 Oct 2014, 07:28 AM
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!
 
0
Ed
Top achievements
Rank 1
answered on 02 Oct 2014, 03:16 PM
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
0
Kiril Nikolov
Telerik team
answered on 03 Oct 2014, 08:56 AM
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!
 
0
Ed
Top achievements
Rank 1
answered on 03 Oct 2014, 06:21 PM
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
0
Accepted
Kiril Nikolov
Telerik team
answered on 06 Oct 2014, 10:35 AM
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!
 
Tags
Window
Asked by
Ed
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Ed
Top achievements
Rank 1
Share this question
or