[CLOSED] DragDrop Grid to Tree - treepanel re-ordering

  1. #1

    [CLOSED] DragDrop Grid to Tree - treepanel re-ordering

    In the example below, I can't seem to re-order the treepanel when combining with a drag and drop from a grid - I've tried tweaking the code but to no avail. Is there a simple way to do this? As it seems the combination of the draggroup and beforedrop event don't allow you to re-order the tree itself.

    https://examples2.ext.net/#/DragDrop/Grid/Grid_to_Tree/

    Any help would be appreciated.
    Thank you,Kev
    Last edited by Daniil; Apr 23, 2013 at 3:54 AM. Reason: [CLOSED]
  2. #2
    Hello!

    Try to use the following:

    <ext:TreeView runat="server">
    	<Listeners>
    		<AfterRender Delay="10" Handler="
    			this.plugins[0].dropZone.addToGroup('tree2grid')
    			"></AfterRender>
    	</Listeners>
    	<Plugins>
    		<ext:TreeViewDragDrop runat="server" DragGroup="tree2grid" DropGroup="grid2tree" NodeHighlightOnDrop="false" />
    	</Plugins>
    	<Listeners>
    		<BeforeDrop Fn="beforerecorddrop" />
    	</Listeners>
    </ext:TreeView>
    But you have to change BeforeDrop handlers.
  3. #3
    Quote Originally Posted by Baidaly View Post
    Hello!

    Try to use the following:

    <ext:TreeView runat="server">
    	<Listeners>
    		<AfterRender Delay="10" Handler="
    			this.plugins[0].dropZone.addToGroup('tree2grid')
    			"></AfterRender>
    	</Listeners>
    	<Plugins>
    		<ext:TreeViewDragDrop runat="server" DragGroup="tree2grid" DropGroup="grid2tree" NodeHighlightOnDrop="false" />
    	</Plugins>
    	<Listeners>
    		<BeforeDrop Fn="beforerecorddrop" />
    	</Listeners>
    </ext:TreeView>
    But you have to change BeforeDrop handlers.
    Hi Baidaly,
    thanks for this, but I'm not sure what you mean "change BeforeDrop handlers"? Are you saying to change them to a handler? What would this achieve?

    Also, the AfterRender listener worked (it allowed drag and drop), but the node contained blank text on drop and you could drop the node above the root node?

    Cheers,
    Kev
  4. #4
    Hi @Kev,

    Quote Originally Posted by Kev View Post
    thanks for this, but I'm not sure what you mean "change BeforeDrop handlers"? Are you saying to change them to a handler? What would this achieve?
    No, @Baidaly meant changing its logic to take dropping within the tree into account.

    The difference between Fn and Handler is explained here.
    http://www.ext.net/2012/12/19/introd...xt-net-events/

    Quote Originally Posted by Kev View Post
    Also, the AfterRender listener worked (it allowed drag and drop), but the node contained blank text on drop
    I think it is why @Baidaly said that you must change the handlers.

    Quote Originally Posted by Kev View Post
    you could drop the node above the root node?
    To get two roots? Only the one root is possible. You can hide a root node if needed setting up RootVisible="false" for a TreePanel. Then a user will get a feel that he drops above the root, but, in affect, it will reordering of root children.

Similar Threads

  1. [CLOSED] DragDrop in treepanel using TreeViewDragDrop plugin
    By pawangyanwali in forum 2.x Legacy Premium Help
    Replies: 14
    Last Post: Apr 29, 2013, 4:36 AM
  2. [CLOSED] DragDrop Grid to Tree
    By UnifyEducation in forum 2.x Legacy Premium Help
    Replies: 11
    Last Post: Sep 21, 2012, 12:29 PM
  3. DragDrop item information from TreePanel
    By Dominik in forum 2.x Help
    Replies: 1
    Last Post: Jun 01, 2012, 9:31 AM
  4. Replies: 1
    Last Post: Apr 24, 2012, 10:27 AM
  5. DragDrop From Grid To Tree
    By bullzzeye in forum 1.x Help
    Replies: 2
    Last Post: Jan 08, 2012, 4:23 AM

Tags for this Thread

Posting Permissions