Custom views API and functions

4 posts, 0 answers
  1. Jaesoon
    Jaesoon avatar
    60 posts
    Member since:
    Oct 2012

    Posted 31 Oct 2018 Link to this post

    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

  2. Nencho
    Admin
    Nencho avatar
    1812 posts

    Posted 02 Nov 2018 Link to this post

    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.
  3. Jim
    Jim avatar
    5 posts
    Member since:
    Jul 2014

    Posted 21 May in reply to Nencho Link to this post

    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.

  4. Dimitar
    Admin
    Dimitar avatar
    669 posts

    Posted 23 May Link to this post

    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.
Back to Top