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

[Solved] Ajax Request from NodeDrop

1 Answer 88 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joni
Top achievements
Rank 1
Joni asked on 13 Sep 2011, 09:46 AM
Hi,
How would I send an AJAX request to the server, as a result of an onNodeDrop event being fired when one node is moved to another place in the treeview?

I want to be able to send information to the controller for that view to change some info in a database.

Thanks

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 13 Sep 2011, 01:40 PM
Hello Joni,

See the client events example. You need the onNodeDropped event (after a successful drop). Its event arguments contain the item dragged, the destinationItem, and the dropPosition (before/after/over). Therefore, you could post them to the server like so:

$.post("/TreeView/Drop", {
    item: treeView.getItemText(e.item),
    dropPosition: e.dropPosition,
    destinationItem: treeView.getItemText(e.destinationItem)
}, function() {
    alert("posted successfully!")
});


Regards,
Alex Gyoshev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Joni
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or