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

Populating events on click event

1 Answer 300 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Francis
Top achievements
Rank 1
Veteran
Francis asked on 19 Jun 2019, 01:16 PM

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. 

 

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 21 Jun 2019, 07:12 AM
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.
Tags
Scheduler
Asked by
Francis
Top achievements
Rank 1
Veteran
Answers by
Nencho
Telerik team
Share this question
or