0

I am using the plugin nestable (jquery) to display few nestable lists on the same page. By default all the lists are expanded. I have found this solution to collapse all the lists enter link description here

my question is how can I chose the state of the lists independently(some default expanded and the other collapsed).?

Community
  • 1
  • 1
mo.dhouibi
  • 565
  • 1
  • 4
  • 18

1 Answers1

0

In the back end , I add a class ('expandmenu') to the item that I want it to be expanded.

Then I add this in the front-end:

 $(".expandmenu [data-action]").each(function () {

                                        if($(this).html()=="Expand"){
                                          $(this).click();  
                                        }

                                        });
mo.dhouibi
  • 565
  • 1
  • 4
  • 18