Our state of the art Gantt chart


Post by sa_cmi »

Hi! I'm getting a "Error: Id collision on 1" when running the minimal example below. Do you know why this could be ?
<html lang="en">
	<head>
        <meta charset="utf-8"/>
        <script src="https://www.bryntum.com/examples/build/gantt.module.js" type="module"></script>
        <link rel="stylesheet" type="text/css" href="https://www.bryntum.com/examples/build/gantt.default.css"/>

        <script type="module">
            import {Gantt, TaskModel, TaskStore} from 'https://www.bryntum.com/examples/build/gantt.module.js';

            const taskStore = new TaskStore({modelClass: TaskModel});

            const gantt = new Gantt({
                autoHeight: true,
                appendTo: 'gantt',
                taskStore: taskStore,
            });

            taskStore.data = [
              {
                "id": 1,
                "name": "Task 1",
                "startDate": "2019-09-18",
                "endDate": "2019-09-22",
                "expanded": true,
                "children": [
                  {
                    "id": 2,
                    "name": "Task 2",
                    "startDate": "2019-09-18",
                    "endDate": "2019-09-19"
                  },
                  {
                    "id": 3,
                    "name": "Task 3",
                    "startDate": "2019-09-20",
                    "endDate": "2019-09-22"
                  }
                ]
              }
            ];

            taskStore.filter(t => false);
            taskStore.data = [
              {
                "id": 1,
                "name": "Task 1",
                "startDate": "2019-09-18",
                "endDate": "2019-09-22",
                "expanded": true,
                "children": [
                  {
                    "id": 2,
                    "name": "Task 2",
                    "startDate": "2019-09-18",
                    "endDate": "2019-09-19"
                  },
                  {
                    "id": 3,
                    "name": "Task 3",
                    "startDate": "2019-09-20",
                    "endDate": "2019-09-22"
                  }
                ]
              }
            ];
        </script>
	</head>

	<body>
        <div id="gantt"></div>
	</body>
</html>

Post by mats »

Confirmed, ticket opened. Does it work for you if you clear filter before setting new data?

https://github.com/bryntum/support/issues/211

Post by sa_cmi »

On this minimal example yes, but with the actual code I'm working on it doesn't always seem to work.

Post by saki »

The issue has been fixed. You can either download next nightly build or wait until the patch release.

Post Reply