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

Custom views API and functions

3 Answers 209 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jaesoon
Top achievements
Rank 1
Jaesoon asked on 01 Nov 2018, 04:08 AM

Hi,

 

I'm trying to utilise the custom view section of the scheduler but cannot find any documentation regarding how to use it,

 

So far i've got the view copying the day view as such:

 

1..Views(views =>
2.{
3.    views.CustomView("CurrentShiftView", a => a.Title("Current Shift"));
4.    views.DayView();
5.    views.WeekView();
6.    views.MonthView();
7.    views.AgendaView();
8.})

 

and the template as follows:

1.var CurrentShiftView = kendo.ui.DayView.extend({
2.    options: {
3.        selectedDateFormat: "{0:D} - {1:D}",
4.    },
5.});

 

 

However, i'm unable to customise the template at all as none of the options i expected would work in it is not being used.

 

For example, i'm guessing if we go by the javascript examples, we can set the start time for the day to be startTime: new date(2018 10 10 5 0 0) and the custom view will have 5am as the start time. Doing the above doesn't seem to do what i expect and so am wondering if there's an API or documentation that I can use.

 

I've also found that clicking on the "Show Full Day" button on the footer moves the view to the "Day" view when the custom view is selected. Is there a way to prevent this from happening?

 

 

Thanks

3 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 02 Nov 2018, 12:56 PM
Hello Jaesoon,

As described in this documentation article, you can overwrite/extend each view and override each method and property that are defined in the list by extending the respective class. Also, as stated in the article, you can revise all of the classes in the source code, in order to determine what exactly needs to be overwritten. 

As for your question about the API and docs - I am afraid that there is none, which targets the customization of the default Views for the Scheduler. 

Lastly, here is an example of custom view implementation in the Scheduler. 

https://www.telerik.com/support/code-library/custom-view-0286055de51d

You can give it a try at your end and let us know if any issues still persist.

Regards,
Nencho
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Jim
Top achievements
Rank 1
answered on 21 May 2019, 04:36 PM

I believe that the example that you reference may need updated?  When selecting the view no data but the dates populate.  Also if you click on view again the dates populate another row. Would you kindly update the example?

My end goal is to have a custom view that can span more then 1 week.

0
Dimitar
Telerik team
answered on 23 May 2019, 06:39 AM
Hello Jim,

Check out the following Dojo example that demonstrates how a custom day view can be created with dynamic length:


The Dojo is based on the following HowTo example.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Scheduler
Asked by
Jaesoon
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Jim
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or