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

[Solved] Register control before render - is it possible?

1 Answer 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jason
Top achievements
Rank 1
Jason asked on 07 Sep 2010, 08:05 PM
I'm running a cross a particular theme on my site, where I have some user input dialog (like a drop down list) which dictates the data to be rendered in a Telerik control (usually a TreeView) via an Ajax postback. The problem I run into is after an ajax post back, javascript is not run (which makes sense) but if the treeview has any drop and drop functionality - it simply doesn't fire since it must be registered via something like

jQuery('#AccountMap').tTreeView({dragAndDrop:{"dropTargets":".drop-area"},        onSelect:onAccountMapNodeSelect, onNodeDragStart:onAccountMapNodeDrag, onNodeDrop:onAccountMapNodeDrop, onNodeDropped:onAccountMapNodeDropped});

which is generated server side, and run client side in the document.ready function.

So my question is how, other than through messy json, can i run that register script, then with an ajax post back render a treeview that is located in a seperate view? If i explicitly call that line in an OnSuccess method, it doesn't seem to work, any ideas?

Btw if I render the control on it's own separate view through a non-ajax method, the control works fine.

-Jason

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 08 Sep 2010, 12:43 PM
Hello Jason,

I believe that you just need to register required javascript files in Site.master in advance. Check this help article for more information.

Sincerely yours,
Georgi Krustev
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Jason
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or