Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Dec 02, 2007 17:51
open dhtmlx forum
drag and drop

Hi,
I need some help setting default cell value when the item is draged from one grid and placed in another grid.
I have 2 grids
mygrid1 = new dhtmlXGridObject('gridbox1');
mygrid1.setImagePath("customized_template/imgs/");
var flds = "Selected Fields";
mygrid1.setHeader(flds);
mygrid1.setColTypes("ed");
mygrid1.setColSorting("str");
and other grid as
mygrid3 = new dhtmlXGridObject('gridbox3');
    mygrid3.setImagePath("customized_template/imgs/");
    var flds = "Sort Fields,Asc,Desc,Action";
    mygrid3.setHeader(flds);
    mygrid3.setColTypes("ed,ch,ch,ed");
    mygrid3.setColSorting("str,str,str,str")
    
when I drag some text from mygrid1 to mygrid3 I want some default text to get entered in the "Action" column.
Is it possible if so how? I will really appreciate your help in this.
Thanks in advance.
Answer posted on Dec 03, 2007 02:24
The way how data transformed while d-n-d can be defined in next way


mygrid3.gridToGrid=function(rowId,sgrid,tgrid){ //this method define how data transformed while d-n-d
    var data=["","","","Default action"]; //default values for all columns
    data[0]=sgrid.cells(rowId,0).getValue();   //get existing values for first column
    return data;
}