[Gantt error] Uncaught RangeError: Maximum call stack size exceeded


Hello, I have a enterprise license to use Gantt and i have problems while using it. When i’m navigating in Grid, quickly open/editing (inline) dates from the same task, the Library throws an error of Maximum Call Stack Size Exceeded.
Our code could be find here: https://snippet.dhtmlx.com/5/ea461eeb9

snippet.dhtmlx.com-1641592371701.log (14.2 KB)


Hello Marcio,
That issue occurs because you return true in the is_changed function. Because of that, the onBeforeSave event fires each time the task is updated, and it creates an unending loop. You need to return true only if the value is really changed.
For the duration_ editor:

  is_changed: function (value, id, column, node) {
    var input = this.get_input(node);
    var actual_value = parseInt(input.value.match(/\d+/)[0]) * 8
    return actual_value !== value;

For the boolean editor:

  is_changed: function (value, id, column, node) {
    return !!this.get_input(node).checked !== !value;

Here is the updated snippet:


Thanks for the help Ramil.
When i am using the end date, i has the same problem occuring between the start and end dates columns. For my custom dates columns, the problem is occuring too. Can you help me again ? I change the columns that were hide ‘true’ to ‘false’.


Hello Marcio,
The issue with the end_date inline editor occurs because you modify the values in the onBeforeSave event handler. And you do that to make the date look inclusive. It is not recommended to modify the dates as it may not work correctly with auto-scheduling or some other Gantt features.
It is better to create a custom inline editor to modify the end_date parameter. By using it, you can change the displayed and entered date without actually changing the value in the HTML element.
Here is a simple example with inclusive dates:

As you use the hour duration unit, you don’t even need to modify the dates.
You can use custom date editors and modify the dates only after the inline editor is closed.
Here is an example with the date input type:
Here we need to modify the dates because the input element with the date type doesn’t have the hour values.

Here is another example with the datetime-local input type:
The input element may take more space, but it will store the dates more accurately.

Here is the snippet with your configuration and the datetime-local input type:

By the way, you can use the formatters to display and modify the duration in the human-readable format: