Gantt getTaskBy

Hello,

I am using gantt.getTaskBy and in the docs it is saying that we can either use a function or a property name and value. That’s what I tried to do in the example below.

I am trying to get the tasks that have a taskType equal to 0. When I am using the function it is working while with the property name and value it isn’t. What am I doing wrong ?

https://snippet.dhtmlx.com/123760612

Hi @ouassim!

It appears to be a bug on our end, thank you for reporting it. I’ve submitted it to our internal tracker, and the dev team will fix it. I think it will be published with one of the next bugfix releases.
As a workaround for the issue, you can use gantt.getTaskBy((task) => { return task.taskType === 0 }, null);

Hello Ouassim,
The dev team fixed the issue with the getTaskBy method.
You can check how it works in the following snippets:
https://snippet.dhtmlx.com/1a989a3bf
https://snippet.dhtmlx.com/123760612

1 Like