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

[Solved] call an AJAX request from clicking on node

1 Answer 114 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 25 Feb 2008, 11:58 PM
I have a RadTreeView which is using TreeNodeExpandMode.ServerSideCallBack.

When a node is clicked, I want to expand the node (if not already), and send an AJAX event to the server. I captured the client OnClientNodeClicking and do an AJAX:

function OnClientNodeClicking(sender, args)
{
 var node = args.get_node();
 // If the tree is not expanded, then expand it now
 if (node.get_expanded() == false)
 {
  node.toggle();
 }
 else
 {
  var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
  ajaxManager.ajaxRequest("test");
 }
}


but I do not know how to tell the tree control to expand (toggle) the tree node, AND send up a AJAX request. It seems to "step on" the AJAX request that actually fills the dropdown if I do the ajaxRequest AND call node.toggle.

Any idea how I can expand the node AND fire an AJAX event?

Thanks

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 27 Feb 2008, 09:03 AM
Hi Jay,

I am not sure whether I can correctly understand your goal.

What about hooking on the OnClientNodeExpanding  event instead of the OnClientNodeClicking. However, it is not a good approach using two ajax mechanisms this way as they might interfere with each other. Nevertheless, I suggest you try wiring the OnClientNodeExpanding event and let us know how this goes.

Sincerely yours,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TreeView
Asked by
Jay
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or