How to : get selected row content -> add to my mySQL Table

Hello,
Could you please tell me howI can do this.

I have a products grid “List” which loads data from a sql query (using render_sql function)
columns rendered are : MemberId, Name, Age, City, Dept

Below this grid, I have a 2nd grid “selected Members” which is blank at start and loads its data from another table.

When using onRowDblClicked event, I would like to :
get the content of the selected row
send them as variables to a php page so that they can be used in a INSERT query into the 2nd grid which reloads after insertion.

Thank you for your advise :slight_smile:

Found a part of a solution by myself :

[code]myGrid.attachEvent(“onRowDblClicked”, function(rId,cInd){

var selected =  new Array();
// We Iterate on column index
for (var i=0; i<myGrid.getColumnCount(); i++)
	{
         	selected[i] = grid_productlist.cells(rId,i).getValue();
	}
	MemberId= selected[0];
	Name= selected[1];
	Age= selected[2];
	City= selected[3];
	Dept= selected[4];

dhtmlxAjax.get("…/class/myfile.php?memberId="+MemberId+"&name="+Name+"&age="+Age+"&city="+City+"&dept="+Dept);[/code]

Maybe there is a more convenient to do this ?

Oops, Error

please replace :

selected[i] = [i]grid_productlist[/i].cells(rId,i).getValue();

by

selected[i] = [i]myGrid[/i].cells(rId,i).getValue();

Sorry

Hi,
sorry for the delay in answerring.
good work :slight_smile: