send grid data to child window when opened

Hello,

I have a grid that opens a new child window when any cell with an index of 9 is selected. The window then displays an attachURL(); page pulling data from a MySQL table and displaying the results. I need to get the data of the first cell of the selected cell’s row and send that data to the URL page to run the appropriate MySQL query. Is there a way to do this?

Thank you,

Grid and Window Init:


 <div id="gridbox" style="padding-right: 5%; padding-left: 5.5%; padding-bottom: 2%; border: none; width: 78%; height: 680px;"></div>
 
 <br/>
 <br/>
 
<script>
	
	mygrid = new dhtmlXGridObject('gridbox');
	
        mygrid.setImagePath("./codebase/imgs/");                 
        mygrid.setHeader("WO,C.R. Start,Prod Stage,Customer,Part Number,FT<sup>2</sup>,Total Units,CR1,CR2,Floor Notes,Production Notes");
	mygrid.attachHeader("#text_filter, ,#text_filter,#text_filter, , , ,#text_filter,#text_filter, , ,");
        mygrid.setInitWidthsP("5,8,8,9,10,4,4,6,6,6,*");          //the widths of columns  
        mygrid.setColAlign("center,center,left,left,center,center,center,center,center,center,left");       //the alignment of columns   
        mygrid.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro");                //the types of columns  
        mygrid.setColSorting("str,str,str,str,str,str,str,str,str,str,str,str,str");          //the sorting types   
		mygrid.setColumnIds("workorder,cleanroom_start,productionstage,customer,partnumber,totalsqft,quantity,claveid,claveid2,floornotes,productionnotes")
		
		var combobox = mygrid.getCombo(2);
		combobox.put("Cleanroom Done","Cleanroom Done")
		
		mygrid.attachEvent("onCellMarked",doOnCellSelected);
		mygrid.enableMarkedCells(true);
	
		mygrid.enableBlockSelection(true);
		mygrid.enableRowsHover(true,'grid_hover');
	
        mygrid.init();      //finishes initialization and renders the grid on the page 
	
	//=========================================================================================
	mygrid.load("gridview_Testing_GET.php");
	myDataProcessor = new dataProcessor("gridview_Testing_UPDATE.php");
	myDataProcessor.enableDataNames(true);
	myDataProcessor.setUpdateMode("cell");//available values: cell (default), row, off
	myDataProcessor.setTransactionMode("GET");
	myDataProcessor.init(mygrid);
//============================================================================================

	function doOnCellSelected(rid,ind,sgref) {
	
  			if (ind == 9) {
				
				var dhxWins = new dhtmlXWindows();
				wFloornotes = dhxWins.createWindow("wFloornotes", 100, 100, 450, 400);
				wFloornotes.setText("Floornotes");
				wFloornotes.center();
				
				wFloornotes.attachURL('floornotes_datalist.php');
				
    		}
	}
</script>

You may try to use the getValue() method:
myGrid.cellById(row_id, col_index).getValue();
or
myGrid.cellBy Index(row_index,col_index).getValue();

I am able to get the value of the cell just fine and successfully test the value in console.log(); My issue is that I can’t get the variable from my php script which I need for a MySQL query. I’ve tried sending the variable as a parameter in attachURL but how do I access that parameter from my php script???

What I’ve tried:

[code]
function doOnCellSelected(rid,ind) {

    //dhxWins.setImagePath("./codebase/imgs/");
    //mygrid.attachEvent("onCellMarked", function(rid, ind) {
		if (ind == 9) {
			
			var sgref = mygrid.cells(rid,11).getValue();
			var dhxWins = new dhtmlXWindows();
			wFloornotes = dhxWins.createWindow("wFloornotes", 100, 100, 450, 400);
			wFloornotes.setText("Floornotes");
			wFloornotes.center();
			
			wFloornotes.attachURL('floornotes_datalist.php', false, { sgref: sgref } );
		
			console.log(sgref);
		}
}
[/code]

I know that the following line of code is suppose to achieve this somehow so if someone can provide a good example of how to use this, that would be greatly appreciated:

 win.getFrame().contentWindow.someFunction(value); 

If you need to transfer value to a server side script, just add it to the used URL

wFloornotes.attachURL(‘floornotes_datalist.php?id=’+sgref, false);

or if you want to use a POST

wFloornotes.attachURL(‘floornotes_datalist.php’, true, { sgref: sgref });