I try to reload my jqgrid after click on the close button in the popup window in IE8. but it gave me several errors and now i tried to reload it in the page itself. meaning that not from the popup window but run a function(resides in main page) upon press the ‘close’ button in the popup.
i am getting an error – ‘window.opener.document’ is null or not an object.(in IE8) please find my code below –
popup window function –
function closeUserPopup(){
//var x = window.opener.document.getElementById("myjqgrid");
//alert(x);
window.opener.document.callReload();
window.close();
}
function in the parent page to reload jqgrid-
function callReload(){
jq("#mygrid").trigger("reloadGrid");
}
is there any way to reload the parent page jqgrid from the popup window ? ?( before it get closed) Thanks in advance.
It’s not
window.opener.documentbutwindow.openerTry to check if the opener is still valid before.
I usually do something like this:
A little suggestion.
I’ve given up with popups like these cause they’re hard to manage.
I tend to use a jQuery UI Dialog so I can manage everything on the same page.
UPDATE
If you’re using
window.showModalDialog();things are even more simple.Here’s an example:
Since you’re creating a dialog the client-script process stops until you close the popup window. At that point, your javascript gets the control back and can fire some other actions.
PS: You can use – as I did – a return value as state here.