> Is there a way to set the property tags from the MVC controller?
If you are using the MVC version you can specify the custom fields using DataTagFields property.
If you load events manually using an AJAX call you can just add it to the event data - see also below.
> Just for your information: args.e.data.tags.justCreated = false; throws an exception. Maybe it has to be args.e.tags.justCreated?
The "tags" field is initialized in onTimeRangeSelected:
var e = new DayPilot.Event({
start: args.start,
end: args.end,
id: DayPilot.guid(),
resource: args.resource,
text: "",
tags: {justCreated: true} // <- here
});
And yes - you should check if args.e.data.tags exists in onEventEdit before using it. Or you can move it inside the conditional block:
dp.onEventEdit = function(args) {
if (args.e.tag("justCreated")) {
if (args.canceled || args.newText === "") {
dp.events.remove(args.e);
}
args.e.data.tags.justCreated = false;
}
};