This topic is locked
[SOLVED]

 Simulate "Close window" button on popup view page

9/16/2020 8:57:02 AM
PHPRunner General questions
K
kausi author

I would need to have special button to close View popup page. I was tryng to simulate it similar to save button solution without any success. Also tried window.close(); but not working. Is there possibilty to close the popup window with custom button?

Admin 9/16/2020

See examples #4 and #6 here:

https://xlinesoft.com/phprunner/docs/how_to_display_any_page_in_a_popup.htm
You need to save the win variable after creating the popup and then use window.win.close();

K
kausi author 9/16/2020



See examples #4 and #6 here:

https://xlinesoft.com/phprunner/docs/how_to_display_any_page_in_a_popup.htm
You need to save the win variable after creating the popup and then use win.close();


Thanks. Would it be possible to use in custom button code pageObj.getItemButton('view_close').click(); described over here link. I have added it to custom button after event without any sucess

Admin 9/16/2020

Yes, it is certainly possible. I think example #6 does exactly what you need, please take another look.
The key is to save the win variable and then window.win.close(); will do the job.

A
alghanim 10/16/2020

try this



var win = Runner.displayPopup( {

url: "backup.php",

width: 800,

height: 600,

header: '',

footer: '<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>',

afterCreate: function(win) {

window.win = win;

}

});