json-tree icon indicating copy to clipboard operation
json-tree copied to clipboard

default to collapsed view?

Open abenrob opened this issue 9 years ago • 2 comments

Is it possible to have the tree default to collapsed on creation?

abenrob avatar Jun 06 '16 12:06 abenrob

Add this:

    this.foldAll= function(){
      var f=document.getElementsByClassName('jstFold');
      for (let i = 0; i < f.length; i++) {
        const it = f[i];
        setTimeout(() => {
          it.click();
        }, 0);
      }
    }

And call it after create, and will work.

LucaGabi avatar Aug 28 '18 17:08 LucaGabi

this.foldAll= function(){ var f=document.getElementsByClassName('jstFold'); //should be jstCollapse NOT jstFold (Apr2020), then it works well ...

JayNaire avatar Apr 22 '21 12:04 JayNaire