I want to delete a selected node on delete key press using OnClientKeyPressing event.
But its still not working after setting the tab to treeview.
Thanks,
vsoni
1 Answer, 1 is accepted
0
Nencho
Telerik team
answered on 20 May 2014, 08:06 AM
Hello Vsoni,
I had performed some local tests, but is seems that the event is correctly triggered and the nodes are properly deleted. Here is the implementation of the OnClientKeyPressing client-side event, that I had used at my end. In addition, please make sure that you have your RadTreeView configured with any TabIndex set:
<script type="text/javascript">
function OnClientKeyPressing(sender, eventArgs) {
var node = eventArgs.get_node();
var key = eventArgs.get_domEvent().keyCode;
if (key == "127")
sender.get_nodes().remove(node)
}
</script>
Regards,
Nencho
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.