This is a migrated thread and some comments may be shown as answers.

RadTreeview OnClientKeyPressing not working

1 Answer 62 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Vsoni
Top achievements
Rank 1
Vsoni asked on 15 May 2014, 01:12 PM
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

Sort by
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.

 
Tags
TreeView
Asked by
Vsoni
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or