Integration between DataProcessor and Scheduler

Hi,

I encountered an error when attach DataProcessor to my scheduler, below is the JavaScript error message that I get.

Error: anObj.parentObject is undefined
Source File: 10.0.0.123/ls-script/dhtmlxDataP … ocessor.js
Line: 470

I get this error because scheduler.parentObject is undefined. How to fix this problem?

Below the script that I use,

function doOnloadScheduler() {
scheduler.config.dblclick_create=false;
scheduler.config.drag_create=false;
scheduler.config.time_step = “5”;
scheduler.config.show_loading=true;
scheduler.config.multi_day = true;
scheduler.config.xml_date=“%d/%m/%Y %H:%i”;
// Timeline Script
scheduler.locale.labels.timeline_tab = “Timeline”;
scheduler.locale.labels.section_custom = “Assign to”;
var sections=[
{key:“AT”, label:“AT=ANTHONY TEO
(View members)”},
{key:“AG”, label:“AG=ANASTASIA GABY
(View members)”},
{key:“EP”, label:“EP=EDWIN PUTRA
(View members)”},
{key:“BT”, label:“BT=BUDI TANJUNG
(View members)”},
{key:“RT”, label:“RT=ROB TSANG
(View members)”},
{key:“DX”, label:“DX=DANIEL X
(View members)”}
];
scheduler.createTimelineView({
name: “timeline”,
x_unit: “hour”,
x_date: “%H:%i”,
x_step: 6,
x_size: 28,
second_scale: {
x_unit: “day”,
x_date: “%d/%m/%Y”
},
y_unit: sections,
y_property: “section_id”,
dy: 30,
render: “bar”
});
scheduler.config.lightbox.sections=[
{name:“description”, height:130, map_to:“text”, type:“textarea” , focus:true},
{name:“custom”, height:23, type:“select”, options:sections, map_to:“section_id” },
{name:“time”, height:72, type:“time”, map_to:“auto”}
];
scheduler.init(“myscheduler”,null,“timeline”);
scheduler.load(“www_lj_test_schdl.xmldata”);
myDataProcessor = new dataProcessor(“www_lj_test_schdl.save_data”);
myDataProcessor.enableDebug(false);
myDataProcessor.enableDataNames(true);
myDataProcessor.setUpdateMode(“cell”); //available values: cell (default), row, off
myDataProcessor.setTransactionMode(“GET”,true);
myDataProcessor.init(myscheduler);
} // end of doOnloadScheduler

Hi,

I want to update the JavaScript,

function doOnloadScheduler() {
scheduler.config.dblclick_create=false;
scheduler.config.drag_create=false;
scheduler.config.time_step = “5”;
scheduler.config.show_loading=true;
scheduler.config.multi_day = true;
scheduler.config.xml_date="%d/%m/%Y %H:%i";
// Timeline Script
scheduler.locale.labels.timeline_tab = “Timeline”;
scheduler.locale.labels.section_custom = “Assign to”;
var sections=[
{key:“AT”, label:“AT=ANTHONY TEO
(View members)”},
{key:“AG”, label:“AG=ANASTASIA GABY
(View members)”},
{key:“EP”, label:“EP=EDWIN PUTRA
(View members)”},
{key:“BT”, label:“BT=BUDI TANJUNG
(View members)”},
{key:“RT”, label:“RT=ROB TSANG
(View members)”},
{key:“DX”, label:“DX=DANIEL X
(View members)”}
];
scheduler.createTimelineView({
name: “timeline”,
x_unit: “hour”,
x_date: “%H:%i”,
x_step: 6,
x_size: 28,
second_scale: {
x_unit: “day”,
x_date: “%d/%m/%Y”
},
y_unit: sections,
y_property: “section_id”,
dy: 30,
render: “bar”
});
scheduler.config.lightbox.sections=[
{name:“description”, height:130, map_to:“text”, type:“textarea” , focus:true},
{name:“custom”, height:23, type:“select”, options:sections, map_to:“section_id” },
{name:“time”, height:72, type:“time”, map_to:“auto”}
];
scheduler.init(“myscheduler”,null,“timeline”);
scheduler.load(“www_lj_test_schdl.xmldata”);
myDataProcessor = new dataProcessor(“www_lj_test_schdl.save_data”);
myDataProcessor.enableDebug(false);
myDataProcessor.enableDataNames(true);
myDataProcessor.setUpdateMode(“cell”); //available values: cell (default), row, off
myDataProcessor.setTransactionMode(“GET”,true);
myDataProcessor.init(scheduler);
} // end of doOnloadScheduler

Is the second code ( with myDataProcessor.init(scheduler); ) still throws and error, or it was fixed after that update ?

Hi Stanis,

It still throw the same error.

Such error (Error: anObj.parentObject is undefined) can occur if you are providing some incorrect object for the dp.init command

Also, if you are not using any other dhtmlx component except of scheduler on the page - be sure that you are not including dhtmlxdataprocessor.js
Error as the above one can occur if you are using really old version of dataprocessor on same page where scheduler resides.

Actually I’m using Scheduler and DataProcessor, do I need to include dhtmlxdataprocessor.js ?

So, what is the version of dataprocessor that we should use?

Hi Stanis,

I just update the DataProcessor to v3.0, it works great.

Thank you for your help.

Regards,
Budi