Treetable drag-n-drop grouping

edited December 2013 in Technical questions

Hi,

i am trying to add a small functionality to the Treetable, i.e. i would like to be able to drag-n-drop siblingA upon siblingB and this should transform siblingB to a parent (with a plus-sign next to it), where siblingA becomes a child to it.

I couldn't find an easy way to do this till now. Could you please show me the right way?

Thanks a lot.

Comments

  • You can enable the desired behavior, by using code like next

    tree.attachEvent("onBeforeDrop", function(context){
          context.parent = context.target;          //drop as child
          context.index = -1;               //as last child
    });
    

    http://snippet.webix.io/c16b9633

    Unfortunately the case when you are transformin leaf item to the branch have a problem ( the above example doesn't work very well after new branch creating )

    To have the correct behavior you need to update the lib as well ( the same fix will be included in the next build )

    https://s3.amazonaws.com/uploads.hipchat.com/15721/61242/ciytWxTboHg8BBw/webix.zip

  • the code you pasted was one of the first i tried and as in the snippet you sent, it had problems. but now with the new version of webix it works. thanks a lot!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!