我有一个带有 iframe 的页面。
iframe 包含一个 gridex 网格,用于侦听双击事件。
双击时会发生这种情况:
function OpenOrderInfo(grid, x, y)
{
if(window.event != null)
{
var r = window.event.srcElement;
while(r != null && r.tagName != "TR")
r = r.parentElement;
if(r == null || r.className == "")
{
return;
}
}
if(grid != null)
{
var row = grid.getSelectedItems().getSelectedItemInIndex(0).getRow();
if(row != null && row.getRowType() == "Record")
{
document.getElementById('hdnSelectedIndex').value = row.getPosition();
var UID =row.getCellByColumnKey("UID").getValue();
var OrderNum = row.getCellByColumnKey("PurchaseOrderNumber").getValue();
var CustomerID = row.getCellByColumnKey("CustomerSiteID").getValue();
var ReadFlag = row.getCellByColumnKey("ReadFlag").originalImage;
var VendorID = row.getCellByColumnKey("VendorSiteID").getValue();
var IsHistoricalPO = row.getCellByColumnKey("IsHistoricalPO").getValue();
var randNum = new Date().getTime();
window.open('', 'OrderInfoWin' + randNum, 'channelmode=no,directories=yes,fullscreen=no,height=670,location=no,menubar=no,resizable=yes,width=860,scrollbars=yes,status=yes,titlebar=no,top=5');
var myform = document.createElement('form');
myform.action = "OrderInfo.aspx";
myform.method = "post";
myform.target = "OrderInfoWin" + randNum;
myform.style.display = "none";
var myinp1 = document.createElement('input');
myinp1.id="myinp1";
myinp1.name="UID";
myinp1.type="hidden";
myinp1.value="";
var myinp2 = document.createElement('input');
myinp2.id="myinp2";
myinp2.name="OrderNum";
myinp2.type="hidden";
myinp2.value="";
var myinp3 = document.createElement('input');
myinp3.id="myinp3";
myinp3.name="CustomerID";
myinp3.type="hidden";
myinp3.value="";
var myinp4 = document.createElement('input');
myinp4.id="myinp4";
myinp4.name="ReadFlag";
myinp4.type="hidden";
myinp4.value="";
var myinp5 = document.createElement('input');
myinp5.id="myinp5";
myinp5.name="VendorID";
myinp5.type="hidden";
myinp5.value="";
var myinp6 = document.createElement('input');
myinp6.id = "myinp6";
myinp6.name = "IsHistoricalPO";
myinp6.type = "hidden";
myinp6.value = "";
myform.appendChild(myinp1);
myform.appendChild(myinp2);
myform.appendChild(myinp3);
myform.appendChild(myinp4);
myform.appendChild(myinp5);
myform.appendChild(myinp6);
document.body.appendChild(myform);
document.getElementById('myinp1').value=UID;
document.getElementById('myinp2').value= OrderNum;
document.getElementById('myinp3').value=CustomerID;
document.getElementById('myinp4').value=ReadFlag;
document.getElementById('myinp5').value=VendorID;
document.getElementById('myinp6').value = IsHistoricalPO;
myform.submit();
document.body.removeChild(myform);
}
}
}
此方法打开一个弹出窗口并将表单提交到其中。
应出现订单信息。
由于某些未知原因,我有时会收到此页面:
依次转到此页面:
我已经调试了该方法,似乎我正在提交部分,但之后没有任何反应。
我已经使用提琴手尝试查看是否正在发出请求,并且似乎没有请求离开浏览器。
该过程正在创建一个临时表单,将其目标设置为一个新的弹出窗口并提交它。