smart rendering js is hiding tasks

Hi ,

After I added dhtmlx_smart_rendering.js , the gantt started hiding tasks .

This happened repeatedly, I have task count greater than 200 and its hiding the tasks from about 200.

please provide some kind of demo, since we can’t reproduce the issue on our samples: … ering.html


I have a sample. I took the filtering example, pasted the smart rendering code inside, and created some tasks. It’s attached to this post. Put the file in the same directory as dhtmlxgantt.js and dhtmlxgantt.css and open it in your browser (I have Chrome). Scroll down to the bottom of the chart, as far as you can, and you should get the problem described here:
Then uncheck and check the Low priority filter checkbox. Smart rendering is on in the file I attached. If you turn smart rendering off, the problem described in the above link and in this thread shouldn’t happen. (2.67 KB)

the gantt in your sample contains about 100 tasks in total, from the first look it seems that it doesn’t shows tasks after #200 because there are none.
03_filtering.html, line 355:

[code] for (var i = 1; i < 200; i += 2) {

  gantt.addTask({id:i+1, text: String(i+1), start_date: new Date(new Date().valueOf() + i*50000), duration: 1.1, priority: 3, parent: 1});

Couple of notes

  1. instead of pasting the code of extension, you can simply add it using a script tag
  1. In your code, each task is loaded into the gantt using gantt.addTask method. This may create a big performance drawbacks when you have more data or complex templates, since each call can invoke redrawing of a chart.
    Instead of this you can either put all events into array and load them at once using gantt.parse, or put code that adds tasks into gantt.batchUpdate in order to make it into one redraw


let me clarify: the task hiding doesn’t appear after task 200, but instead some of the tasks fail to render at times. I posted an example where some of them would not show. I think the number of tasks doesn’t seem to matter as long as there is a vertical scroll bar. some screenshots of what I meant the last time:

Here I have scrolled down to the bottom as far as possible.

Here I have unchecked the low priority filter. All the tasks are marked as low priority except the top-level task, which is marked as high priority. We should see the top-level task but nothing is visible (but we can see it if smart rendering is off).

Here I have rechecked the low priority filter box. We should see all the tasks again but none show. If smart rendering is off then we see the tasks at the top of the chart and the scroll bar is set to the bottom of the chart (bug?).

Actually if you scroll down only a little from the top, then uncheck and recheck the low priority checkbox, you will see some misaligned tasks. Once you scroll down enough they become so misaligned that you see no tasks anymore.