$(function (){ var indx_ID; $("#grdTest th").each(function (index) { if ($(this).html().indexOf("编码") > 0) { indx_ID = index; } }); function callback(val){ $("#value").html(val); } $("#btnPZ").click(function(){ var grid = document.all.grdTest; var rowIndex = document.all.grdTest_selectedRowIndex.value; var r = rowIndex *1 +1; var x = document.all.grdTest_selectedRowIndex.value; //取单击选中的记录值 var pkValue = grid.rows[r].cells[indx_ID * 1].innerText; if(isEmpty(x)) { $("#lblMsg").html("请先选择一行网格数据!"); //alert("请先选择一行网格数据!"); return false; } var strFile="CommPage.aspx?para=pu=3023&CS="+pkValue; openWin(strFile,'物料配置',callback,{w : 1000,h :800}); }); });