i couldn't understand why, but i built gantt chart from ms project on sharepoint, with many subtask, and I would like to hide subtasks by default.
Unfortunately, any script that i put above my gantt chart doesn't work and produce anything...
i tried every type of link , nothing work... i couldn't understand the problem.. i tried what is explained here, with that code : Why is this jQuery not working on my Sharepoint page? but nothing work enter image description here
<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(){
        if(jQuery(this).css('margin-left')!="0px"){
            jQuery(this).parent().parent().parent().hide();
        }
    });
}
</script>
thanks
