Populating events on click event

2 posts, 0 answers
  1. Francis
    Francis avatar
    12 posts
    Member since:
    Jun 2019

    Posted 19 Jun 2019 Link to this post

    Hi,

    I'm trying to populate events in the scheduler however i cannot get the event items to show.

     

    I have checked and the json that is returned looks like this:

    {
        "title": "Start up all PCs",
        "start": "2013-06-06T08:00:00",
        "end": "2013-06-06T08:05:00"
      },
      {
        "title": "20 min test",
        "start": "2013-06-06T08:05:00",
        "end": "2013-06-06T08:25:00"
      }

    The scheduler setup looks like this: 

        $("#scheduler").kendoScheduler({
            views: ["day"],
            startTime: new Date("2013/6/6 08:00"),
            endTime: new Date("2013/6/6 20:30"),
            dataSource: {
                batch: true,
                transport: {
                    read: {
                        url: "Templates/getappointments/@Model.TemplateID",
                        dataType: "json"
                    },
                    parameterMap: function(options, operation) {
                        if (operation !== "read" && options.models) {
                            return {models: kendo.stringify(options.models)};
                        }
                    }
                },
                schema: {
                    model: {
                        fields: {                        
                            title: { from: "Title", defaultValue: "No title", validation: { required: true } },
                            start: { type: "date", from: "Start" },
                            end: { type: "date", from: "End" }
                        }
                    }
                }
            },
            editable: false,
            footer: false,
            currentTimeMarker: false,
        });

     

    I have tried a lot of things however i cannot get the events to show. 

     

  2. Nencho
    Admin
    Nencho avatar
    1871 posts

    Posted 21 Jun 2019 Link to this post

    Hello Francis,

    I would suggest you to refer to the following documentation article, demonstrating different aspects of the approach that you attempt to use:

    https://docs.telerik.com/kendo-ui/api/javascript/ui/scheduler/fields/datasource

    Generally, you need to add the new event object to the Scheduler Data Source, in order to include the event. Also, please note the format of the data that needs to be provided for the 
    add method.

    In addition, here is another dojo example, using the code snippet that you provided as a base:

    https://dojo.telerik.com/@nenchef/AleFiliX/2

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