I'm trying to find a way to hide the subtasks in a view by default. I've tried a few javascripts and snippets and can't get anything to work.


1 Answer 1


I don't see any out of the box way for doing this. Using JavaScript you can achieve this by

  1. Find all div which has class = itx
  2. Do a loop of those div and for each item check the SPAN inside has style Margin-Left = 0; If its 0 then that means its PARENT else its a SubTask
  3. Now you can get the Parent TR of that item and hide it

Try the below sample

jQuery('div[class="ms-vb  itx"]').find('span[style]').each(function(){

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.