Build 1736 now copies all properties of the makeDraggable parameter (except of "duration" and "element") to the newly created DayPilot.Event.data property (which is accessible in onBeforeEventRender as args.e).
This means you can specify additional properties directly (such as barColor, backColor, etc.):
var item = {
element: e, // source element that will be removed from DOM on drop
id: "1",
text: "Event text",
duration: 3600, // 1 hour
barColor: "red",
barBackColor: "white"
};
DayPilot.Scheduler.makeDraggable(item);
You can also specify custom properties to be used in onBeforeEventRender. It is recommended to store custom properties in "tags" object (in order to prevent conflict with the standard properties in the future):
var item = {
element: e, // source element that will be removed from DOM on drop
id: "1",
text: "Event text",
duration: 3600, // 1 hour
tags: {
color: "red",
status: "unallocated"
}
};
DayPilot.Scheduler.makeDraggable(item);
dp.onBeforeEventRender = function(args) {
if (args.e.tags && args.e.tags.status === "unallocated") {
args.html = "unallocated";
}
};
You can download the latest build in the sandbox:
http://javascript.daypilot.org/sandbox/scheduler/external.html