javascript - ExtJS 6. Unable to add a node to a treepanel -


for reason, in extjs 6 cannot worked literally years previous versions of library. cannot add new node selected one. code have:

//tree.store.getrootnode().insertbefore(node, tree.store.getrootnode().firstchild); // ^^^ works. nodes added root selected.insertbefore(node, selected.firstchild); // ^^^ not work, though "selected" ordinary node // leaf = false 

if check "selected" node , "selected.firstchild", see expect see - normal nodes:

console.log(selected); // <-- see indeed node, selected console.log(selected.firstchild); // <-- it's ok. 

when node added, parent remains collapsed. maybe that's why can't see it. try expanding parent node. example:

selected.insertbefore(node, selected.firstchild); selected.expand(); 

or maybe selected leaf node (not allowing children). have selected.set('leaf', false) please take @ this working fiddle


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -