Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by paw on Dec 04, 2007 07:04
open dhtmlx forum
drag and drop of cells in between grids

sir, I got your answer regarding the "mercy drag mode". However, I need only a cell form a certain row to be dragged and dropped to another grid.
Answer posted by Stanislav on Dec 04, 2007 10:09
There is no such built in functionality , but you can use event handler and define any custom reaction.


targetGrid.attachEvent("onDrag",function(sid,tid,sgrid,tgrid,scol,tcol){
    //code here will be executed when item from sourceGrid drag-n-dropped on item in target grid

/*
The next values available, knowing them you can execute any necessary command ( setting value, adding new row, etc )
*     sid:  ID of source item
*     tid:  ID of target item
*     sgrid:  source grid object
*     tgrid:  target grid object
*     scol:  index of column from which drag started
*     tcol:  index of column in which drop occurs
*/

    return false; // block default reaction
});


>> I need only a cell form a certain row to be dragged and dropped to another grid.
There is no way to make only few rows dragable ( can be done by code modification ) , but by using onDrag event handler you can block d-n-d reaction on unnecessary rows.