I'm currently developing a prototype that utilizes Kendo UI Pro with a heavy reliance on the TreeListView and Drag and Drop functionalities. I have implemented a custom drop location using an Angular 1.x custom directive. Within this directive's link
method, I am connecting to the element using kendoDropTarget()
. My intention was for this method to automatically provide me with the associated Kendo model of the dropped tree row, but it appears that is not the case (unless I am missing something.)
I attempted to set and retrieve the dataTransfer
on the object based on information from MDN in this manner:
$scope.treeListOptions = {
//...
drag: function (e) {
e.dataTransfer.setData('text/plain', JSON.stringify(e.source));
}
};
And within my directive, something similar to:
app.directive('dropLoc', function () {
return {
// ...
link: function (scope, ele, attrs, ctrl) {
ele.kendoDropTarget({
dragenter: function (e) {
var data = e.dataTransfer.getData('text/plain');
console.log(data);
}
});
}
};
However, the above code leads to an error stating e.dataTransfer is undefined
.
Therefore, my inquiry is how can I effectively retrieve the model from a Kendo-enabled widget?
Is it necessary to set up numerous data-
attributes?