Hi, I am using gantt to display a project timeline. I’ve built functionality that allows users to filter out groups of tasks based on various critieria. Here is an example (scroll to the right to see the important parts):
I do this using code that looks like this:
gantt.attachEvent("onBeforeTaskDisplay", function(id, task) {
var productsAndReleasesToShow = $("#productTree").fancytree('getRootNode').tree.getSelectedNodes() || [];
// If empty, show everything
if (productsAndReleasesToShow.length === 0) {
return true;
}
var idsOfproductsAndReleasesToShow = extractIdsFromProductsAndReleases(productsAndReleasesToShow);
var tasksToShow = findTasksAlignedToProductsAndReleases(gantt, idsOfproductsAndReleasesToShow);
return taskOrParentTaskOrChildTaskIsOneOfTasksToShow(gantt,
tasksToShow, task);
});
The problem is that when I hide these tasks, I want to shrink the parent task timeline, but that doesn’t seem to happen, even when I use gantt.resetProjectDates(task); .
(scroll to the right to see the important parts)
Is this because I am hiding tasks vs completely removing them? What is the best way to enable this behavior?
Here’s a snippet that shows a simplified version: