質問

I would like to auto select the parent after deleting a selected node.

The following is code that I use to delete a node and any children if there is any

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

How would I auto select the parent node after the delete?

役に立ちましたか?

解決

Try the folllowing:

var selectedNode = treeview.select();
var parentNode = treeview.parent(selectedNode);
$(selectedNode).children('.k-group').remove(); // you don't actually need this line of code
treeview.remove(selectedNode);
treeview.select(parentNode); 

Take a look through the documentation too:

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top