cancel
Fired when the user cancels tasks's cell editing by pressing the 'Esc' key.
The event handler function context (available via the this keyword) will be set to the widget instance.
Event Data
e.container jQuery
The jQuery object representing the wrapping cell element. That element contains the editing UI.
e.task kendo.data.GanttTask
The GanttTask which has been edited.
e.preventDefault Function
If invoked prevents the cancel action and keeps the cell in edit mode.
e.sender kendo.ui.Gantt
The widget instance which fired the event.
Example - subscribe to the "cancel" event during initialization
<div id="gantt"></div>
<script>
$("#gantt").kendoGantt({
dataSource: [
{
id: 1,
orderId: 0,
parentId: null,
title: "Task1",
start: new Date("2014/6/17 11:00"),
end: new Date("2014/6/17 14:00")
}
],
columns: [ { field: "title", title: "Title", editable: true } ],
cancel: function(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("Cancel editing task: ", e.task.title);
}
});
</script>
Example - subscribe to the "cancel" event after initialization
<div id="gantt"></div>
<script>
function gantt_cancel(e) {
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log("Cancel editing task: ", e.task.title)
}
$("#gantt").kendoGantt({
dataSource: [
{
id: 1,
orderId: 0,
parentId: null,
title: "Task1",
start: new Date("2014/6/17 9:00"),
end: new Date("2014/6/17 11:00")
}
],
columns: [ { field: "title", title: "Title", editable: true } ]
});
var gantt = $("#gantt").data("kendoGantt");
gantt.bind("cancel", gantt_cancel);
</script>