This is a migrated thread and some comments may be shown as answers.

How can i call a function defined in my masterpage from radwindow

0 Answers 117 Views
Window
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 08 Nov 2017, 07:36 AM

I have a masterpage where a have defined a function below

 function PopUpShowing(sender, eventArgs) {
                var popUp = eventArgs.get_popUp();
                var scrollTop = (typeof window.innerHeight != 'undefined' ? 0 : document.documentElement.scrollTop);
                var popUpWidth = popUp.style.width.substr(0, popUp.style.width.indexOf("px"));
                var popUpHeight = popUp.style.height.substr(0, popUp.style.height.indexOf("px"));
                var windowHeight = (typeof window.innerHeight != 'undefined' ? window.innerHeight : document.body.offsetHeight - scrollTop);
                var windowWidth = document.body.offsetWidth;
                if (popUpHeight == "") popUpHeight = 300; // if the height isn't set on the popup, default to 300px 
                popUp.style.position = "fixed";
                popUp.style.left = (Math.floor((windowWidth - popUpWidth) / 2)).toString() + "px";
                popUp.style.top = (Math.floor((windowHeight - popUpHeight) / 4) + scrollTop).toString() + "px";
            }

Then i have i page that opens a radwindow on button click. The radwindow contains a radgrid that has a popup editing set. So i want to call the PopUpShowing function in the masterpage to display the popup.

No answers yet. Maybe you can help?

Tags
Window
Asked by
Peter
Top achievements
Rank 1
Share this question
or