我目前正在使用dhtmlxgrid向用户显示mysql记录。当用户选择特定单元格时(在第9列中),会弹出一个新的dhtmlxwindow,显示一个表单和来自mysql表的更多数据。我需要获取网格行的第一个列单元格的值,并将该数据发送到dhtmlxwindow以在我的MySQL查询中使用。
注意:我使用的是attachURL();在我的弹出窗口中显示一个html页面,所以我需要将网格数据发送到新窗口,然后发送到窗口中包含的url页面。
如何将网格数据发送到最终目的地?
感谢所有帮助。
我的代码:
网格/窗口初始化:
<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');
//the path to images required by grid
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,*");
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");
mygrid.setColSorting("str,str,str,str,str,str,str,str,str,str,str,str,str");
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();
//==========================================================================
mygrid.load("gridview_Testing_GET.php");
myDataProcessor = new dataProcessor("gridview_Testing_UPDATE.php");
myDataProcessor.enableDataNames(true);
myDataProcessor.setUpdateMode("cell");
myDataProcessor.setTransactionMode("GET");
myDataProcessor.init(mygrid);
//==============================================================================
function doOnCellSelected(rid,ind) {
if (ind == 9) {
var sgref = mygrid.cells(rid,0).getValue();
var dhxWins = new dhtmlXWindows();
wFloornotes = dhxWins.createWindow("wFloornotes", 100, 100, 450, 400);
wFloornotes.setText("Floornotes");
wFloornotes.center();
wFloornotes.attachURL('floornotes_datalist.php');
}
}
</script>
我需要从floornotes_datalist.php访问网格单元格值。
答案 0 :(得分:0)
请尝试使用: wFloornotes.attachURL( 'floornotes_datalist.php sgref =?' + sgref);