drag and drop grid

Hi, i’ve some questions, i have two grids, grid A contains 3 columns, (img, str, str) and i fill this grid with a mySQL database, in my grid B i’ve again 3 columns (img,ed,str), here are my quiestions

  1. When i drag and drop an element from grid A into grid B, how can i do to put only the last 2 columns (or indicate what columns i need) of grid A into grid B, in order to edit some data, or how can i pass all the data of one column in blank? it’s possible?

  2. Can you provide me some example of usign dataprocessor in grid B?, i want to save the data in grid B, but i don’t know exactly in what event call the dataprocessor, i think that is something like “onAfterDrop”, any idea?

Thanks in advance for your response. :nerd:

  1. This is possible. You can use drag-and-drop events or gridToGrid method. Please find more information here docs.dhtmlx.com/doku.php?id=dhtm … ween_grids
    docs.dhtmlx.com/doku.php?id=dhtm … ag_landing
    docs.dhtmlx.com/doku.php?id=dhtm … g_and_drop

  2. You should create separate instance of DataProcessor for grid B. It will monitor changes in grid B and send requests to the server side if necessary. If case of drag-and-drop when you drop item to the grid B, “inserted” or “updated” action type will be fired.
    You should note the dataprocessor detects the row changed only by edit operations. If a row was changed by a direct API calling it will not be updated. You can manually call the dataprocessor to inform about the update operation:
    grid.cells(id,ind).setValue(new_one)
    dp.setUpdated(id,true);

but i don’t know exactly in what event call the dataprocessor, i think that is something like “onAfterDrop”
You can use “onDrop” event. This event occurs when drag-and-drop operation is finished

You can find list of all available events here docs.dhtmlx.com/doku.php?id=dhtmlxgrid:events

  1. This is possible. You can use drag-and-drop events or gridToGrid method. Please find more information here

Thanks a lot for the links Olga, i’ll check it

If a row was changed by a direct API calling it will not be updated.

what do you mean with “was changed by a direct API calling”

Thanks in advance for your response

Hi, i’m trying to do this

treeGrid.attachEvent(“onDrop”,function(sid,tid,sgrid,tgrid){
alert (“dataprocessor”);
var selcliente=document.getElementById(“CustNumber”);
var y=selcliente.options[selcliente.selectedIndex].value;
var x=y.split("|");
myDataProcessor = new dataProcessor("./dataprocessor_equivalencias.php?valor0=<?php echo $_SESSION['id_usuario']; ?>&cliente="+x[0]);
myDataProcessor.enableDataNames(true);
myDataProcessor.setTransactionMode(“POST”,true);
//myDataProcessor.setUpdateMode(“Off”);
myDataProcessor.init(treeGrid);
myDataProcessor.enableDebug(true);

})

but it doenst work for the first time that i drop into grid B, any ideas?

thanks

what do you mean with “was changed by a direct API calling”
DataProcessor update is not calling if you are changing cell value with setValue() method.

but it doenst work for the first time that i drop into grid B, any ideas
You should define grid B DataProcessor instance outside “onDrop” event handler.

DataProcessor update is not calling if you are changing cell value with setValue() method.

ok, i understand

You should define grid B DataProcessor instance outside “onDrop” event handler.

yep, i got it, but now when i drag items fron grid A into grid B everything is fine, and when i edit too, my dataprocessor does the action, “insert” , “update” , “delete”, but sometimes when i want to delete all the items that i put on grid B, the grid only underline the row and the row doesnt disappears, any ideas?

i checked it with the firebug and the dataprocessor fires correct and the query to, i.e, the items doenst appears in my database.

thanks in advance for your response

Please check if you are using latest version of dhtmlxDataProcessor. If issue still occurs please create ticket at support.dhtmlx.com/ and provide us any kind of sample where we can reproduce this issue.

hi, i got the last version of dataprocessor.js and now everything works fine, but now, i have one question about dataprocessor, how can put dataprocessor initialization without an url?

i mean, i have 3 combos and my dataprocessor url recieves a parameters (depens on combos values), but, for instance, if i want to change some combo value, and select another possible value, i need to pass this value into the dataprocessor url, in this point i think that i’m initializing two dataprocessors, when i click on “submit” i read the combos values and i do something like

myDataProcessor = new dataProcessor("./dataprocessor_equivalencias.php?cliente="+x[0]+"&org="+org_value+"&sec="+sec_value);

so, how can avoid this?

thanks in advance for your responses