I want collapse pre item before expend a new item,how can do this?
Hmmm... it looks like from the docs that toggle(state, element) would do it - but the element parameter is not in the code. So we have not coded it.
We will add that to the todo list. It is quite complicated so can't do it right now... will add it for ZIM 017. For now, this might do what you want. Insert this line BEFORE the objList.on("expanded"...
objList.on("mousedown", ()=>objList.updateTree())
There are paddingLeft, paddingRight parameters that you can use to shift the components.
We will take a look at the toggle() element parameter when we do ZIM 017.