I got dataSource config
new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: '/getnodes'
}
},
schema: {
model: {
id: '_id'
}
}
})
also I have a method wich provide adding nodes to treeview
addNode: function() {
var tree = this.tree, //this.tree == $('#treeview').(/* config here */).data('kendoTreeView')
sel = tree.select();
/* some code here */
$.ajax({
url: '/addnode',
data: {parent: parent},
success: function(row) {
el.append({
_id: row._id,
name: row.name
}, sel);
}
})
}
so what we have
node will added success, but afer - dataSource generate request to '/getnodes' and get it from database and render it to treeview
in result we have two same node in one brunch
please help to solve this problem
new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: '/getnodes'
}
},
schema: {
model: {
id: '_id'
}
}
})
also I have a method wich provide adding nodes to treeview
addNode: function() {
var tree = this.tree, //this.tree == $('#treeview').(/* config here */).data('kendoTreeView')
sel = tree.select();
/* some code here */
$.ajax({
url: '/addnode',
data: {parent: parent},
success: function(row) {
el.append({
_id: row._id,
name: row.name
}, sel);
}
})
}
so what we have
node will added success, but afer - dataSource generate request to '/getnodes' and get it from database and render it to treeview
in result we have two same node in one brunch
please help to solve this problem