add

Fired when a new event is about to be added.

The event handler function context (available via the this keyword) will be set to the widget instance.

Event Data

e.event Object

The event data from which the SchedulerEvent instance will be created and added to the DataSource.

e.preventDefault Function

If invoked prevents the add action.

e.sender kendo.ui.Scheduler

The widget instance which fired the event.

Example - subscribe to the "add" event during initialization

<div id="scheduler"></div>
<script>
$("#scheduler").kendoScheduler({
  date: new Date("2013/6/6"),
  views: [ "day", "month" ],
  dataSource: [
    {
      id: 1,
      start: new Date("2013/6/6 08:00 AM"),
      end: new Date("2013/6/6 09:00 AM"),
      title: "Interview"
    }
  ],
  add: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log("Add", e.event.title);
  }
});
</script>

Example - subscribe to the "add" event after initialization

<div id="scheduler"></div>
<script>
function scheduler_add(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
  console.log("Add", e.start);
}
$("#scheduler").kendoScheduler({
  date: new Date("2013/6/6"),
  views: [ "day", "month" ],
  dataSource: [
    {
      id: 1,
      start: new Date("2013/6/6 08:00 AM"),
      end: new Date("2013/6/6 09:00 AM"),
      title: "Interview"
    }
  ]
});
var scheduler = $("#scheduler").data("kendoScheduler");
scheduler.bind("add", scheduler_add);
</script>
In this article
Not finding the help you need? Improve this article