Bug: treetimeline + round_position + drag


I have used treetimeline with round_position: true configuration. It works correctly, but if I try to resize event from it’s left or right border it throws following exception.

Uncaught TypeError: Cannot read property ‘_resize_from_start’ of undefined

Line 482 - dhtmlxscheduler_timeline.js
case “resize”:
if (this._drag_event._resize_from_start == null)

It will not throw exception if I have:
-created new event
-moved some event
-selected some event by using scheduler.select

I have also tested it by using samples\06_timeline\03_tree.html and got same exception. You have to only add round_position: true configuration and you will see it.

scheduler.select method will not help, but if you first click event and then resize it then it works.

try replacing your dhtmlxscheduler_timeline.js with the attached one. Does the issue still appears there?
dhtmlxscheduler_timeline_130125.zip (9.9 KB)

Yes, same exception has been throwed in line 229. this._drag_event is undefined.

// will save and use resize position only once
if (this._drag_event._resize_from_start == null) {

I have tried to debug it and maybe the reason is that when i start resize operation:

  1. dhtmlxscheduler_treetimeline.js onBeforeDrag is called and then inside that method line:
    var g = scheduler._locate_cell_timeline(d);

  2. line calls dhtmlxscheduler_timeline.js and there
    var pos = scheduler.getActionData(e);

  3. dhtmlxscheduler.js -> var b = this._mouse_coords(a);

  4. dhtmlxscheduler.js -> var a = scheduler._props[this._mode], d = h.apply(this, arguments);

  5. dhtmlxscheduler.js -> scheduler._mouse_coords = function(a)

return e.call(this, b);

  1. and e.call calls dhtmlxscheduler_timeline.js

scheduler[“mouse_” + obj.name] = function(pos) { //mouse_coord handler

and that mouse_coord handler function tries to get event object var ev = this._drag_event; and in there _drag_event is undefined.

The bug has been confirmed, thank you for reporting the problem.
Please try the updated timeline.js
dhtmlxscheduler_timeline_130128.zip (9.91 KB)

The specified bug has been fixed, thanks, but other very CRITICAL bug has been found.

The schduler UI works perfectly, but if you use DataProcessor all ajax calls has not been executed.

It is very strange, but if you move event from top to bottom ajax call is not executed every single time. I have not found any rule when it is not executed. If I move events from bottom to top all ajax calls has been executed.

You can seen bug if you add following lines to the samples\06_timeline\03_tree.html

var dp = new dataProcessor("data/events_tree_db.php");

There is no bug if you use original dhtmlxscheduler_timeline.js file.

I think that the new bug is not related to the other one because if I add the statement inside case “resize”:


everything works fine. So there are other bug inside new version of xx_timeline.js.

the bug has been confirmed, sorry for the inconveniences.
Please try the fixed version of timeline.js
dhtmlxscheduler_timeline_130204.zip (9.92 KB)