none
SharePoint 2013 - Tasks List | Automatically Hide Sub Tasks in a View

    Question

  • Hello Community,

    I'm working in SharePoint 2016 with a Task List that has Subtasks and I'm trying to use the Outline feature in the Task Tab, Hierarchy section, Outline button, but the button isn't working, it just gives me an error.  What do I need to do to automatically Hide Subtasks in a View?

    Thanks!

    Tom


    Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award - Linked-In - SharePoint Gypsy

    Wednesday, April 5, 2017 5:28 PM

Answers

  • Hi Tom,

    What the error when you hide subtasks?

    We can also click the following icon to hide subtasks.


    If you want to show all subtasks collapsed by default, try add the following scripts to the list view.

    function doCollapseTaskList() {
    
                   $(".ms-commentcollapse-iconouter > img").each(function(){
    
                                   $(this).click();
    
                   });
    
    }
    
    $(function () {
    
          ExecuteOrDelayUntilScriptLoaded(function () {
    
              if (typeof asyncDeltaManager != "undefined")
    
                asyncDeltaManager.add_endRequest(doCollapseTaskList);
    
              else doCollapseTaskList();
    
          }, "init.js");
    
    });


    Best Regards,

    Linda Zhang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    • Marked as answer by Tom Molskow Friday, April 7, 2017 5:50 PM
    Thursday, April 6, 2017 8:32 AM
    Moderator