javascript - auto select the parent after deleting a selected node -


i auto select parent after deleting selected node.

the following code use delete node , children if there any

           var selectednode = treeview.select();             $(selectednode).children('.k-group').remove();             treeview.remove(selectednode); 

how auto select parent node after delete?

try folllowing:

var selectednode = treeview.select(); var parentnode = treeview.parent(selectednode); $(selectednode).children('.k-group').remove(); // don't need line of code treeview.remove(selectednode); treeview.select(parentnode);  

take through documentation too:


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -