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

How execute javascript when selected = true

1 Answer 57 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Isabelle
Top achievements
Rank 1
Isabelle asked on 10 Feb 2016, 08:38 PM

Hi,

 I have a javascript function who is executed when the client click :

 treeView.OnClientNodeClicking = "MyJavascriptFunction"

It works great.

So, i have another code-behind function who select a node like that :

Dim node4 As RadTreeNode = treeView.FindNodeByValue(txtHiddenModele.Value)


If node4 IsNot Nothing Then
  node4.Selected = True          
End If

 

It works too, the node is selected but the javascript function is not executed (MyJavascriptFunction)

 

How can i solve this?

 

Thanks!

 

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 15 Feb 2016, 09:45 AM
Hi Isabelle,

This behavior is expected since you are executing this logic on the server-side. Basically, you have two options to call your script function in this case:

1. Transfer the code-behind logic to client-side and find and select the item using javascript.
2. After selecting the item on code-behind, use the RegisterStartupScript method to execute your javascript function.

I hope this will prove helpful.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TreeView
Asked by
Isabelle
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or