I was wondering if there is a way to set the view to either day or week based upon screen size within a scheduler view model? The scheduler I am trying to build will display the day view in mobile portrait and week view in mobile landscape. Your help is much appreciated!
3 Answers, 1 is accepted
0
Vladimir Iliev
Telerik team
answered on 24 Jun 2015, 03:38 PM
Hello George,
You can use the "onorientationchange" event to detect when the orientation is changed and change the current view using the "view" method of the scheduler. Please check the example below:
$(window).on("orientationchange",function(e){
//detect the orientation
var scheduler = $("[data-role=scheduler]").getKendoScheduler();
scheduler.view("week"); //or 'day' depending on the orientation
});
Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
This works. However, I noticed that if the edit event window is opened, and if a user rotates the mobile device from portrait to landscape, the edit event window closes and does not reopen when the view is reset. How can i prevent this from happening?
0
Vladimir Iliev
Telerik team
answered on 30 Sep 2015, 07:55 AM
Hello George,
The desired behavior of preserving the edit window when switching views is not supported out of the box and custom solution would be required. Possible solution is to use the "dataBinding" event to detect if there is edit window to save it's UID / ID and use it on next "dataBound" event to edit the event again using "edit" method.
Regards,
Vladimir Iliev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!