json-tree
json-tree copied to clipboard
default to collapsed view?
Is it possible to have the tree default to collapsed on creation?
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.
this.foldAll= function(){ var f=document.getElementsByClassName('jstFold'); //should be jstCollapse NOT jstFold (Apr2020), then it works well ...