문제

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