Hello,
I'm new here and I'm trying to figure out how can I drag and drop from a Grid to a TreeView
I found this example http://dojo.telerik.com/eWIgu/2
It's something like this what I want to do, but in the example I can't put an element in a certain node of the TreeView, I just add elements to the data source. So how can I do that? I need your help
PS. I also want to do this with a listbox instead of a grid. That's possible?
I am trying to disable the drag/drop within the treeview (as in the user wont be able to move any items anywhere inside the treeview). However I am not coming up with a solution for this issue.
I still want the user to be able to drag/drop an item that's inside the treeview over to my listview box as well as drag/drop it back to the treeview box.
So is it possible to disable the drag/drop feature inside the treeview when keeping the drag/drop from there to my listbox?
Hey all I need a hand here. I've been at this for a few hours now and I just can't find how this code is bringing back the old value(s).
const onCheck = (e) => {
let listBox = $("#Sources").data("kendoListBox"),
treeView = $("#availableSources").data("kendoTreeView"),
selection = [],
getSelection = (items) => {
items.forEach(item => {
if (item.hasChildren) {
getSelection(item.items);
} else if (item.checked) {
selection.push(item);
}
});
};
if (e.node.attributes[3].value == "false") {
listBox.remove(listBox.items());
$("#Sources option[value='" + listBox.dataSource._data[0].value + "']").remove();
//selection.pop(listBox.dataSource._data[0]);
} else {
getSelection(treeView.dataSource.data());
if (selection.length) {
selection.forEach(item => {
listBox.add({
text: item.text,
value: item.id
});
});
}
}
}
As an example say I checked the item Github and it places it into the listbox just fine. It also adds the ID of the item to the hidden select component.
Now say I uncheck that item now:
Great! It removed the item from the listbox and also from the hidden select component. However though, when I chose another item, say GitHubIssues I am presented with not only that item in the listbox but the pervious item is placed into the select component.
It has the correct item in the listbox but I am unsure as to why its keeping the previous value(s)?