Hi,
we have a treegrid and a normal grid on 1 page. we are dragging items from the tree grid to the normal grid. however when they are being dropped into the grid they are not in the same order as they were in the tree, they are in reverse order.
e.g:
in the tree we could have items:
item 1
item 2
item 3
then when we drag and drop them all into the grid they are being added as follows:
item 3
item 2
item 1
please can you tell us how to get the order exactly the same when they are being dropped into the grid
thanks
Such problem may occur for dhtmlxTreeGrid 1.3 or older - just update to latest version.
In case of dhtmlxgrid 1.4 the items droped in order of selection, so if you select items in order 3,2,1 - they will be inserted in target grid in same order.
Starting from dhtmlxGrid 1.4 you can use next command
grid.enableDragOrder(true);
which force to maintain same order after d-n-d
Hi, ok thanks that works fine except if i drag a whole folder into a grid
e.g.
folder 1:
item 1
item 2
item 3
if i drag the folder into the grid it drops as:
item 3
item 2
item 1
even when i have the grid.enableDragOrder(true); that you just gave me
thanks
This questions was asked a long time ago and it is very important that we get an answer to this question
Thanks
Can you also tell us the following: when a folder is dragged to another grid the source id only provides the folder id and not its kids, is there a way that we can get an array of all ids that were dragged even folder children
thanks
please answer the main question above also as we have been waiting for a very long time for you to answer. thanks
Hi, we have just noticed that there is a huge bug in this drag and drop - we tried to drag 4 folders across with the multi select and when dragged across everything was not in the correct order - all the children from all folders went into one folder - then when we clicked on a folder all the other folders disappeared. please get back to us asap with the answer as to why this is and a fix for it.
please also answer the questions as to why when we drag a folder to another tree grid why all of its contents are reversed even when we specify the code enableDropOrder(true); we are using v 1.4 as well
please reply asap as we have a deadline and our customer is beginning to get very upset that there seams to be so many bugs with this drag and drop
thanks
If it helps you in explaining the bug to us when the user drags over an item that has children:
like i said when an item is dragged that has children it reverses the order of the children - however i have just noticed that when i apply a grid.forEachRow function it actually loops through the rows in the correct order - so why are they appearing in the wrong order - very strange
thanks, i look forward to your reply
This questions was asked a long time ago and it is very important that we get an answer to this question
Issue fixed, fix will be released as part of oncoming update,
If you need it ASAP - please contact directly at support@dhtmlx.com and provide your ref. number.
Can you also tell us the following: when a folder is dragged to another
grid the source id only provides the folder id and not its kids, is
there a way that we can get an array of all ids that were dragged even
folder children
You can use
grid.getSubItems(…
or
grid.getAllSubItems
to get list of child rows
we tried to drag 4 folders across with the multi select and when
dragged across everything was not in the correct order
If problem still occurs for you - please provide any kind of sample where it can be reconstructed.