Hi,
I have a Tree using clientside drag and drop and load on demand with webservice.
How can I update the Tree-Structure on the Serverside with calling a webmethod at the end of the client-event onNodeDropping?
Example:
and Serverside:
Is it possible to get the clientside Eventargs to Serverside?
Thank you very much
Christian
I have a Tree using clientside drag and drop and load on demand with webservice.
How can I update the Tree-Structure on the Serverside with calling a webmethod at the end of the client-event onNodeDropping?
Example:
| function onNodeDropping(sender, eventArgs) |
| { |
| var destinationNode = eventArgs.get_destNode(); |
| if(destinationNode) |
| { |
| var sourceNodes = eventArgs.get_sourceNodes(); |
| var firstTreeView = sourceNodes[0].get_treeView(); |
| var secondTreeView = destinationNode.get_treeView(); |
| var firstTreeViewID= sourceNodes[0].get_treeView().get_id(); |
| var secondTreeViewID = destinationNode.get_treeView().get_id(); |
| firstTreeView.trackChanges(); |
| secondTreeView.trackChanges(); |
| var type = "over"; |
| for (var i = 0; i < sourceNodes.length; i++) |
| { |
| var sourceNode = sourceNodes[i]; |
| //sourceNode.get_parent().get_nodes().remove(sourceNode); |
| if(eventArgs.get_dropPosition() == "over") |
| { |
| destinationNode.get_nodes().add(sourceNode); |
| } |
| if(eventArgs.get_dropPosition() == "above") |
| { |
| insertBefore(destinationNode, sourceNode); |
| type = "above"; |
| } |
| if(eventArgs.get_dropPosition() == "below") |
| { |
| insertAfter(destinationNode, sourceNode); |
| type = "below"; |
| } |
| } |
| destinationNode.set_expanded(true); |
| firstTreeView.commitChanges(); |
| secondTreeView.commitChanges(); |
| // Save State Serverside |
| WebInterface._webServices.MainAjaxServices.InsertNodes(eventArgs, "type", null, null); |
| } |
| } |
and Serverside:
| [WebMethod( EnableSession = true )] |
| [ScriptMethod] |
| public void InsertNodes( RadTreeNodeDragDropEventArgs NodeEvent, string type ) |
| { |
| // Update the Tree-XMl Serverside |
| } |
Is it possible to get the clientside Eventargs to Serverside?
Thank you very much
Christian
