This topic is locked
[SOLVED]

How to display a page in a popup window

3/4/2022 8:46:16 PM
PHPRunner General questions
D
Daviant author

Greetings;

I'm using Example 8 from this article How to display a page in a popup window
and it works great, but it could work better. The popup that I open only needs the save button and when clicking on it the objective is that the window closes and returns to the previous Listpage and refreshes. I added a new save button to add closing code, but it doesn't work.

The code for the new save button is as follows:
ClientBefore

pageObj.on('beforeSave', function(formObj, fieldControlsArr, pageObj){

formObj.baseParams['golist'] = "1";

});
$("#saveButton1").click();
return false;

img alt

The recording is also done correctly. It only remains for the window to close.

I've tried the close command on different events, but to no avail. Please any guidance to solve this problem. I think it can help many.

Very thankful..
(Google translator

D
Daviant author 3/5/2022

Well, giving a little more back to the matter, I managed to fix it.

I added a line to the code to the new Save button (I had already done it before and it didn't work), leaving it as follows:

ClientBefore

pageObj.on('beforeSave', function(formObj, fieldControlsArr, pageObj){
formObj.baseParams['golist'] = "1";
});
$("#saveButton1").click();
window.parent.popup.close();
return false;

And the code of example 8 of the link of the example must modify the ClientAfter of the custom button added to the list grid., being as follows:

ClientAfter

window.popup = Runner.displayPopup( {
url: "customers_edit.php?editid1="+result["CustomerID"],
width: 700,
height: 500,
header: 'View customer',
beforeClose: function(win) {
window.parent.location.reload();
return true;
}
}
);

This way it works perfect. Thank you very much to all.

D
Daviant author 3/5/2022

I hope it serves you all. I consider it SOLVED.

(Google translator)