How can I set parent on a task properly with validation programmatically?
I am using gantt-4.3.2
I tried the following, and it works and are triggering UI to redraw fine. But there are no validation to check if this is an illegal parent:
(You can replicate this by running the code in the advanced example)
gantt.taskStore.getById(15)["parentId"] = 12
I would expect e.g. a "setParent" function that validates the input, but that does not exists:
Ok that is perfect! But I found 1 more issue when setting parent to null:
gantt.taskStore.getById(15)["parentId"] = null;
There are already functions for setting start/end date, duration etc (see attachment), so maybe there should be a setParent or setParentId function anyway?
- Screenshot 2022-01-21 124750.png (31.53 KiB) Viewed 185 times
There are methods like
To add a task to root, you can use
All the best,