I’m trying to persist scheduler events in a database and I’m running into issues loading events back into the scheduler. I’m using both data processor and connector. The specific problem I’m having involves mixing repeating events with single events.
If the user creates a new event, leaving the repeating event “Disabled”, and hits the save button, the rec_type field in the database receives the value “null”. When connector loads the null value back into scheduler it breaks with a “Object doesn’t support this property or method” javascript error.
If the user creates a new event and configures the repeating event box (so repeating events are enabled) the rec_type field will receive a value and the schedule will correctly load the event.
I assume either my Data Processor is not correctly writing single event details into the database, or my Connector table is formatted wrong for mixed single and repeating events. What values are expected in the rec_type, event_length, and event_pid fields if the event is a single event?
[code]====================================
Log started, Thu Feb 23 14:41:21 CST 2012
DB query
SELECT SCHEDULE_ID AS “id”, EVENT_START AS “event_start”, EVENT_END AS “event_end”, EVENT_TEXT AS “event_text”, EVENT_TYPE as “rec_type”, EVENT_LENGTH as “event_length”, EVENT_PID as “event_pid” FROM SCHEDULE WHERE SCENARIO_ID = 100
Done in : 0ms[/code]
The relevant portion of my table schema is:
"SCHEDULE_ID" VARCHAR2(64 BYTE) NOT NULL ENABLE,
"SCENARIO_ID" NUMBER NOT NULL ENABLE,
"EVENT_START" VARCHAR2(64 BYTE) NOT NULL ENABLE,
"EVENT_END" VARCHAR2(64 BYTE) NOT NULL ENABLE,
"EVENT_TEXT" VARCHAR2(256 BYTE),
"EVENT_TYPE" VARCHAR2(64 BYTE),
"EVENT_LENGTH" NUMBER,
"EVENT_PID" NUMBER Note: the EVENT_TYPE attribute is storing the rec_type value.
I had isolated the problem to the “null” string being passed back instead of the empty string “” in values of rect_type. I was able to fix it by extending the ConnectorBehavior for the Scheduler connector and adding a beforeRender function that checked for a null rect_type and replaced the null with “”. I don’t know if this is the optimal solution, but appears to be working.
I sure wish there had been a resolution posted here. I am having the exact same problem with Scheduler putting in the null into the database for the rec_type.
graphicsmart, I still would suggest attaching onBeforeRender handler instead of modifying connector files (as they could be updated and fix will be lost).
onBeforeRender handler won’t cause any side effects.
Kind regards,
Ilya
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan