search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

How to work with dp.tasks.list.find(), dp.tasks.list.find() not working for subtasks.

Asked by Bikram Jeet Singh
5 months ago.

Hello,

I was trying to access the task at level 2 and greater, does the dp.tasks.list.find() work after level1.

Was able to access the level0 and level1 item but after that it gives a null value.

Thank you.

Answer posted by Dan Letecky [DayPilot]
5 months 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
5 months 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]
5 months 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 months old and has been closed. Please create a new question if you have anything to add.