Is there any way to check the status of the ctrl-key during a drop event? I've tried monitoring the state of the ctrl key tracking the mouseup event in the treeview element but it doesn't fire when the drop is completed. What I'm trying to accomplish is to only "copy" the node (rather than move it) if the user drags the node to another node when the ctrl key is held down.
5 Answers, 1 is accepted
0
Hi Scott,
You can check the event argument that will be actual dom event where you can check the ctrl key. Here is an example:
http://dojo.telerik.com/oreVa
Regards,
Kiril Nikolov
Telerik
You can check the event argument that will be actual dom event where you can check the ctrl key. Here is an example:
http://dojo.telerik.com/oreVa
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Scott
Top achievements
Rank 1
answered on 23 Jun 2015, 02:22 PM
Thanks for the answer, but e.ctrlKey is undefined during the treeview drop event. I define my treeview like this:
<
div
class
=
"files"
id
=
"treeview"
data-role
=
"treeview"
data-drag-and-drop
=
"true"
data-text-field
=
"name"
data-spritecssclass-field
=
"type"
data-bind
=
"visible: isVisible, source: files, events: { drop: onNodeDrop, select: onNodeSelect } "
>
</
div
>
I bind it like this:
jobBookAPI.viewModel = kendo.observable({
isVisible: true,
onNodeSelect: function (e)
{
},
onNodeDrop: function (e) // Internal drop handler (node to node).
{
alert(e.ctrlKey); // This is undefined
},
files: kendo.observableHierarchy(jobBookAPI.directoryContents)
});
kendo.bind($("#example"), jobBookAPI.viewModel);
e.ctrlKey is undefined in the onNodeDrop event. Any idea why?
0
Accepted
Hello Scott,
Since the latest release there is the originalEvent argument:
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Peter
Top achievements
Rank 1
answered on 27 Apr 2016, 01:23 AM
Can this work somehow with a 'change' event on a ComboBox?
I want to detect whether Ctrl is being held when a ComboBox item is selected/chosen.
But I cannot find any similar property passed by kendo in the change event parameter
0
Hi,
The Combobox is a different widget that does not expose such event. Please send us a separate support request with some more detailed explanation, so we can see what can be done in your case.
Regards,
Kiril Nikolov
Telerik
The Combobox is a different widget that does not expose such event. Please send us a separate support request with some more detailed explanation, so we can see what can be done in your case.
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!