Hello,
I`m having a bit of a problem, I have set up a tree view, everything get's loaded properly. The problem that I am facing is that I cannot for some reason access the source and target data items.
The thing that baffles me is that on the select using e.node event I`m getting the proper data:
{_events: Object, _handlers: Object, _id:
"56e687375f800af840a30683"
, name:
"5"
, tenantId:
"56bdcc6c3a0328620c306d72"
…}
_childrenOptions: Object
_events: Object
_handlers: Object
_id:
"56e687375f800af840a30683"
_loaded:
false
address: me.extend.init
assets: me.extend.init[0]
attrs: me.extend.init[0]
childNodes: me.extend.init[0]
dirty:
false
hasChildren:
false
id:
"56e687375f800af840a30683"
index: 1
name:
"5"
parent: ()
parentId:
"56e687305f800af840a30681"
path:
"1/3/5"
tenantId:
"56bdcc6c3a0328620c306d72"
uid:
"a8b4032a-db93-452c-a622-3fe93a5b4ab4"
But in the drop using the same thing on e.destinationNode or e.targetNode I get something like this
o {_events: Object, _handlers: Object, _loaded:
true
, text:
"↵ ↵ 5↵"
, uid:
"9030564d-9f42-491c-8824-21983e3cbe04"
…}
_childrenOptions: Object
_events: Object
_handlers: Object
_loaded:
true
children: J.extend.init
dirty:
false
expanded:
false
hasChildren:
false
id:
""
items: me.extend.init[0]
parent: ()
text:
"↵ ↵ 5↵"
uid:
"9030564d-9f42-491c-8824-21983e3cbe04"
__proto__: i
In both cases I`m using:
$(
"#treeview2"
).data(
"kendoTreeView"
).dataItem(e.destinationNode)
Treeview:
$(
"#treeview2"
).kendoTreeView({
dataSource: schema,
dataTextField:
"name"
,
dragAndDrop:
true
,
drag: drag,
drop: drop,
select: select,
dataBound: onDataBound,
template :kendo.template($(
"#treeview-template"
).html())
});
Schema:
var
schema =
new
kendo.data.HierarchicalDataSource({
transport: {
read:
function
(options) {
// ajax request
}
},
schema: {
model: {
id:
"_id"
,
hasChildren:
"hasLocations"
,
children:
"chd"
}
}
});