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

Select Event of RadTreeView Node ONLY on Client-Side

2 Answers 121 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 22 Apr 2015, 07:37 AM

Hello,

I'm working on a project that contains a RadTreeView.

When the user clicks on a node, it fires the JS event “OnClientClicking”.

 

Sometimes we need to set args.set_cancel(true), in order to prevent going to server side.

Therefore, the node that was clicked is not selected, nor is it highlighted.

How can I prevent the event from accessing the server side – yet select the node and highlight it?

Thanks,
Daniel.

2 Answers, 1 is accepted

Sort by
0
Accepted
Bozhidar
Telerik team
answered on 24 Apr 2015, 06:57 AM
Hello,

You can use the following code:
function onClientNodeClicking(sender, args) {
    args.get_node().set_selected(true);
    args.set_cancel(true);
}


Regards,
Bozhidar
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Daniel
Top achievements
Rank 1
answered on 29 Apr 2015, 09:11 AM
Hello Bozhidar,

Thank you for your answer,
Indeed it does the job! 

Sincerely,
Daniel
Tags
TreeView
Asked by
Daniel
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or