0

I'm trying to edit script editor webpart in Sharepoint 2013 online (chrome removed) so that all grouped sublists would be collapsed by default. It's already set to collapsed by default in document library view options. But when i expand grouped list on the site it will be shown after page reload though.

Something like that was already discussed there but it still doesn't working to me.

Here is my last version.

<script type="text/javascript" src="http://code.jquery.com/jquery-1.2.6.min.js"></script>
<script type="text/javascript">

$(document).ready(function () {
   $(".ms-commentcollapse-icon").click();
});
</script>

1 Answers1

0

Try Using below code:

<script type="text/javascript" src="http://code.jquery.com/jquery-1.2.6.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        debugger;
        $("span.ms-commentcollapse-iconouter").each(function(index, node) {
            node.click();
        });
    });
</script>

Note:

Make sure you have added this script editor after (below all list web-parts in page) all your list web-parts.

Ganesh Sanap - MVP
  • 44,918
  • 21
  • 30
  • 61