Answer posted by Dan Letecky [DayPilot] 2 years ago.
The tasks.list property contains the original array of tasks. Its find() method is the standard Array.prototype.find() method, which searches through the array items.
To find a task by its ID within the entire task tree, you can use the tasks.find() method.
Comment posted by Bikram Jeet Singh 2 years ago.
Oh, I got confused. I’m using the tasks.find() method to access the items. But after level 2, it is giving null value.
I can access the level 0 and 1 tasks by this method. Does the tasks.find() searches the whole tree?
Comment posted by Dan Letecky [DayPilot] 2 years ago.
Yes, the tasks.find() method searches the whole tree. You might want to check the task IDs to see if the values are what you expect. Please note that the ID must fully match the tasks.find() argument, including type (i.e. 3 !== "3").
This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.