Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Chris on Jan 16, 2008 08:01
open dhtmlx forum
Drag and Drop Multiselected Items in Grid

Hey,
I want to know if it is possible to drag and drop multiple items in a datagrid.
I tried something like this but did not have success with that.
var helpstring = "";
ids = mygrid.getSelectedId().split(',');
for(i=0;i<=ids.length;i++)
{
mygrid.moveRow(target_ID+i);
}
return true;

It would help a lot if this would be possible.
Thank you
Answer posted by Support on Jan 16, 2008 08:25
Pro version supports drag-n-grop of multiple items ( just enable multiselect and drag-n-drop for grid )
If you want move many items programmatically it can be done as
    var ids = mygrid.getSelectedId().split(',');
    for(var i=0;i<=ids.length;i++)
        mygrid.moveRowTo(...

moveRowTo accepts next parameters
: srowId - source row Id
: trowId - target row Id
: mode - move or copy
: dropmode - sibling or child
: sourceGrid - target row  in row_sibling mode
: targetGrid - used for moving between grids (optional)

        mygrid.moveRowTo(ids[i],target_row_id,"move","sibling");