I'm currently using the following piece of code to hide all the subtasks from my view.
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script>
jQuery(document).ready(function(){
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', run);
});
function run(){
jQuery('div[class="ms-vb itx"]').find('span[style]').each(function(){
var left = Number(jQuery(this).css('margin-left').replace("px",""));
if(left>20){
jQuery(this).parent().parent().parent().remove();//hide();
}
});
}
</script>
I'm now trying to convert that list of parent tasks into a Gantt view however it still displays the subtasks inside said Gantt view and i've had no success trying to hide them.
Any help hiding the subtasks on the Gantt view is greatly appreciated.
I