I am using the Endless Scroll feature and I am trying to implement a "Collapse All Groups" function. The problem is that, with Endless Scroll, I don't have all groups visible when I run my function.
I am using this code to iterate and collapse groups"
I tried to do it recursively, like this:
This works with a small set of data, but when I have more than 500 records, the processes of collapsing takes some time and it breaks my recursive solution.
Any ideas or other solutions?