Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

Modal Popup

$
0
0
Well, I have no hair left to pull out after two solid days of trying to display an add window in a modal popup. I believe I have read every post on the subject multiple times and followed the instructions a best as I can (I am not a practiced javascript coder.....) and I still cannot get the popup to appear.
I have enabled all popups in the browser (Chromium and FireFox), I do not see any javascript errors being generated, I can see the function being called, but nothing appears on the screen!
I have created the following javascript file called MigTools10.js:

====================================================================

function displayPopup(params)
{
var pageid=1;
var pageObj = Runner.pages.PageManager.getById(pageid);
args = {
bodyContent: "<iframe frameborder='0' id='popupIframe" + pageid + "' style='width: 100%; height: 100%; border: 0;'></iframe>",
footerContent: "<span> </span>",
headerContent: params.headerContent,
centered: true,
render: true,
width: params.width ? params.width : 450,
height: params.height ? params.height : 315
},
afterCreateHandler = function(win) {
var bodyNode = $(win.bodyNode.getDOMNode()),
iframeNode = $("iframe#popupIframe" + pageid, bodyNode);

iframeNode.load(function() {
if (Runner.isChrome) {
bodyNode.addClass("noScrollBar");
}
win.show();

}).attr("src", params.url);
},
afterCloseHandler = params.afterClose;

if (Runner.isChrome) {
$("< style type='text/css'> .yui3-widget-bd::-webkit-scrollbar {display:none;} < /style>").appendTo("head");
}

Runner.pages.PageManager.createFlyWin.call(pageObj, args, true,
afterCreateHandler, afterCloseHandler);
}

function select_env()
{
params =
{
url: 'MIGTOOLS_SELECT_ENV_add.php',
afterClose: function(win)
{
win.destroy(true);
},
headerContent: 'Select Connection'
};

displayPopup(params);
}

=================================================================================

and placed the following in the header option on the editor tab (Version 10):

=================================================================================

<script src="MigTools10.js" type="text/javascript"></SCRIPT>

=================================================================================

Then in the Client Before event of a custom button on a list page I have this:

=================================================================================

select_env();

=================================================================================

As I said - I can see this function being called and apparently without any errors, so why does the popup not appear?

Thanks for the help.....

Viewing all articles
Browse latest Browse all 2586

Trending Articles