Hi,
I have a problem with remove newly created nodes from a treeview, in that it gives an error "TypeError: r[0] is undefined".
This only happens with newly created nodes, if a tree is reloaded after appending the node, then the removal works fine.
Versions:
<link href="//da7xgjtj801h2.cloudfront.net/2013.1.514/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="//da7xgjtj801h2.cloudfront.net/2013.1.514/styles/kendo.bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="//da7xgjtj801h2.cloudfront.net/2013.1.514/js/kendo.all.min.js" type="text/javascript"></script>
Using Firefox.
Process:
Add node:
function addToTree(id, data) { // This works just fine.
var treeView = $element.data("kendoTreeView");
var getitem = treeView.dataSource.get(id);
var selectitem = treeView.findByUid(getitem.uid);
treeView.append(data, selectitem);
}
function removeFromTree () {
var $parent = treeView.parent(treeView.select());
treeView.remove(treeView.select());
treeView.select($parent);
treeView.trigger('select', { node: $parent });
}
// First we add to the tree
addToTree(targetId, newNode);
// Then we select the node, and display the appropriate info panel.
....
// Then we try to remove the node
removeFromTree(); // error is thrown, and it is thrown even if the parent selection code is removed leaving only the remove command.
The remove function works just fine if the tree is reloaded after adding the node, but clearly that is not a workable method. Any ideas on what is wrong with the "new node"?
I have a problem with remove newly created nodes from a treeview, in that it gives an error "TypeError: r[0] is undefined".
This only happens with newly created nodes, if a tree is reloaded after appending the node, then the removal works fine.
Versions:
<link href="//da7xgjtj801h2.cloudfront.net/2013.1.514/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<link href="//da7xgjtj801h2.cloudfront.net/2013.1.514/styles/kendo.bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="//da7xgjtj801h2.cloudfront.net/2013.1.514/js/kendo.all.min.js" type="text/javascript"></script>
Using Firefox.
Process:
Add node:
function addToTree(id, data) { // This works just fine.
var treeView = $element.data("kendoTreeView");
var getitem = treeView.dataSource.get(id);
var selectitem = treeView.findByUid(getitem.uid);
treeView.append(data, selectitem);
}
function removeFromTree () {
var $parent = treeView.parent(treeView.select());
treeView.remove(treeView.select());
treeView.select($parent);
treeView.trigger('select', { node: $parent });
}
// First we add to the tree
addToTree(targetId, newNode);
// Then we select the node, and display the appropriate info panel.
....
// Then we try to remove the node
removeFromTree(); // error is thrown, and it is thrown even if the parent selection code is removed leaving only the remove command.
The remove function works just fine if the tree is reloaded after adding the node, but clearly that is not a workable method. Any ideas on what is wrong with the "new node"?