I am using the following JavaScript to append a child node to the selected node:
var nodeText = prompt("Please enter a description", "");
if (nodeText != null && nodeText != "")
{
var treeView = $('#catalogTreeView').data('kendoTreeView');
var selectedNode = treeView.select();
treeView.append( { text: nodeText }, $(selectedNode));
}
The first attempt results in an exception thrown in kendo.web.min.js at:
return this.insert(this._data.length,a) (_data is undefined)
However, if I immediately attempt to add the child node again, it appends without any errors.
The nodes for this TreeView are loaded using an MVC DataSource. However, I would like my users to be able to append nodes manually.
var nodeText = prompt("Please enter a description", "");
if (nodeText != null && nodeText != "")
{
var treeView = $('#catalogTreeView').data('kendoTreeView');
var selectedNode = treeView.select();
treeView.append( { text: nodeText }, $(selectedNode));
}
The first attempt results in an exception thrown in kendo.web.min.js at:
return this.insert(this._data.length,a) (_data is undefined)
However, if I immediately attempt to add the child node again, it appends without any errors.
The nodes for this TreeView are loaded using an MVC DataSource. However, I would like my users to be able to append nodes manually.