Вопрос

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