本文介绍了弹出窗口中的弹出窗口,第二个弹出窗口没有焦点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
好吧,我知道这听起来很奇怪,但这正是客户想要的.我正在一个弹出窗口中工作,当用户单击某个列中的datagrid单元格时,它将弹出一个包含数据的html表.我有第二个弹出窗口要显示,但是没有得到焦点.当前,这是我用来创建第二个弹出窗口的代码.将注意力集中在第二个弹出窗口上的任何帮助都是很棒的.
Ok I know this is going to sound weird but it is what the client wants. I am working within a popup and when a user clicks on a datagrid cell within a certain column it will popup a html table with data. I have the second popup to display but it does not get focus. This is currently the code I am using to create the second popup. Any help to get the focus on this second popup would be great.
function onCellClick() {
var cmGrid = igtbl_getGridById("countermeasureDetailsGrid");
var cmCellID = cmGrid.ActiveCell.split("_");
if (cmCellID[3] === "3") {
var countermeasureID = igtbl_getCellById("countermeasureDetailsGrid_rc_" + cmCellID[2] + "_0").getValue();
var recordType = igtbl_getCellById("countermeasureDetailsGrid_rc_" + cmCellID[2] + "_4").getValue();
_crfPopupWindow = new crfPopupWindow(countermeasureID, recordType);
_crfPopupWindow.open();
_crfPopupWindow.focus();
}
}
function crfPopupWindow(countermeasureID, recordType) {
var crfPopup = new WindowDef();
crfPopup.target = "CRF_Popup.aspx?countermeasureID=" + countermeasureID + "&" + "recordType=" + recordType;
crfPopup.windowName = "CRFPopup";
crfPopup.toolBar = "no";
crfPopup.resizable = "yes";
crfPopup.scrollbars = "yes";
crfPopup.location = "yes";
crfPopup.width = 350;
crfPopup.height = 400;
return crfPopup;
}
解决方案
<script type="text/javascript" language="javascript">
function init() {
window.focus();
}
</script>
推荐答案
window.专注于页面加载
window.focus on page load This works
这篇关于弹出窗口中的弹出窗口,第二个弹出窗口没有焦点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!