I am just starting to use Dynatree and stuck while updating the node display order to database while DragnDrop nodes to and fro.

I tried to google a bit and could not find any helpful links.

So, it will be greatly appreciated of any one can help or shared some helpful links.

Thanks.

有帮助吗?

解决方案

I have solved my problem by storing keys on array and use that array to update database for display order index.

dynatree:
onDrop: function (node, sourceNode, hitMode, ui, draggable) {
{
var resultsToClientNode = [];
sourceNode.move(node, hitMode);
$.map(sourceNode.getParent().getChildren(), function (nodelist) {
    if (nodelist.data.addClass == sourceNode.data.addClass) {
        resultsToClientNode.push(nodelist.data.key);
    }
});
// This array "resultsToClientNode" holds your node on DragDroped order.
// Call ajax to update in database.'
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top