I have scheduler that works fine excluding onExternalDragIn.
No any reaction on drag in, no any error in console log.
What’s wrong?
function initScheduler() {
scheduler.locale.labels.timeline_tab = "Timeline";
scheduler.locale.labels.section_custom="Section";
scheduler.config.drag_create = true;
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.config.collision_limit = 1;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
var sections = [];
scheduler.createTimelineView({
section_autoheight: false,
name: "timeline",
x_unit: "month",
x_date: "%m",
x_step: 1,
x_size: 48,
x_start: 0,
dy: 23,
x_length: 20,
y_unit:sections,
// y_unit: sections,
y_property: "section_id",
folder_events_available: true,
render:"tree",
second_scale:{
x_unit: "year", // unit which should be used for second scale
x_date: "%Y" // date format which should be used for second scale, "July 01"
}
});
scheduler.config.lightbox.sections=[
{name:"description", height:130, map_to:"text", type:"textarea" , focus:true},
{name:"custom", height:23, type:"timeline", options:sections, map_to:"section_id" },
{name:"time", height:72, type:"time", map_to:"auto"}
];
scheduler.config.show_loading = true;
cellVersionsLayout.attachScheduler(new Date(2013,05,30), "timeline");
scheduler.load("versions.php");
var dp = new dataProcessor("versions.php");
dp.init(scheduler);
scheduler.attachEvent("onBeforeEventChanged", function(ev, e, flag, ev_old){
if (ev.section_id==ev_old.section_id) //any custom logic here
return true;
});
scheduler.attachEvent("onExternalDragIn", function(id, source, e) {
var label = tree2.getItemText(tree2._dragged[0].id);
scheduler.getEvent(id).text = label;
alert(label);
return true;
});
scheduler.attachEvent("onClick", function (id, e){
scheduler.showEvent(id);
var secId = scheduler.getEvent(id).section_id;
var startDate = scheduler.getEvent(id).start_date;
var endDate = scheduler.getEvent(id).end_date;
var procVers = scheduler.getEvent(id).text;
var procName = scheduler.getSection(secId).label;
winHeader = "Процесс: " + procVers + ", " + procName + " (" + startDate + " - " + endDate + ") ";
loadInputs(id);
loadOutputs(id);
loadClasses(id);
loadProcProp(id);
win.setText(winHeader);
});
}