Cannot use updateRow or updateRows method to add add rows with children
paul121 opened this issue · 3 comments
When using updateRow
or updateRows
to add rows with child rows it seems that these are not correctly added.. I get a row label of undefined
and then when adding tasks for these rows via updateTasks
I get the following error:
TypeError: Cannot read properties of undefined (reading 'y')
It seems that the y
value might not be set for these new rows?
Adding child rows does work when using gantt.$set({rows})
. I also tested adding these rows all as parent/top-level rows via updateRow
and updateRows
and they worked fine, all tasks were added correctly with updateTasks
.
I see that the updateRow
and updateRows
methods call rowFactory.createRow(model, null)
where null
is the Y value:
svelte-gantt/packages/svelte-gantt/src/Gantt.svelte
Lines 676 to 683 in 773a6a9
But the initRows
logic is different calls rowFactory.createRows(rows)
:
svelte-gantt/packages/svelte-gantt/src/Gantt.svelte
Lines 461 to 465 in 773a6a9
It seems that rowFactory.createRows
is the only method that ever calls rowFactory.createChildRows
:
svelte-gantt/packages/svelte-gantt/src/core/row.ts
Lines 59 to 65 in 773a6a9
Thank you. This is about to be fixed in v4.4.1