Skip to content

Commit

Permalink
Property initialize properties of new scheduler items.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Berger committed Apr 27, 2015
1 parent 95b527f commit 35fe842
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docroot/breeze-kendo.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* You can get the latest version at https://github.com/iozag/breeze-kendo.
*
* Version 0.1.0
*
*
* Released under Apache 2.0 licence (http://kendoui-labs.telerik.com/#license)
*
*/
Expand Down Expand Up @@ -547,6 +547,22 @@
_this._change();
_this.transport._cancelChanges();
}
},

_createNewModel: function (model) {
var newModel = kendo.data.SchedulerDataSource.prototype._createNewModel.call(this, model);

// Make sure that the model has properties properly initialized. This is a requirement
// of the Scheduler templates (Otherwise an exception will be thrown if an new empty
// event is shown in the edit dialog of the scheduler) and might also be a requirement
// of the backend (which for example expects isAllDay to be an valid boolean and not
// null)
newModel.title = '';
newModel.recurrenceId = 0;
newModel.recurs = false;
newModel.isAllDay = false;

return newModel;
}
});
})(jQuery, kendo, breeze);

0 comments on commit 35fe842

Please sign in to comment.