Filter to not display parent node with no task


Please take a look at this snippet

Is there anyway to not display the parent node, if there is no children node?

This is the sample data.

Searching for feedback will result as such.


Is there a way to detect and not display Development and Feature develop node if there is no child task after the search.

As I need to always display the parent node if there is a result under the parent node, my approach currently is to always display if it’s a parent which is better than only display the actual task that being searched on.

This is not the desired behavior where the parent node is not shown


if (gantt.getChildren(id).length > 0) return true;

Which is really a hack/workaround but I can’t think of a better way at the moment.


Hello Joseph,
I have a little different implementation to show filtered tasks. You can recursively check all children of each task.
Here is the snippet:

Hi @ramil,

That looks good, thanks! But don’t mind if I ask, why are you doing

match += 1?

Is there a difference if I use match = true instead?


Hello Joseph,
Yes, you can use match = true. The match += 1 selector was used in a different example where it was necessary to select several filters. Here are similar examples where you can check several parameters:

Alright, thanks for the tips.