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

How to set the Size of Window?

1 Answer 211 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jiten
Top achievements
Rank 1
Jiten asked on 06 Apr 2012, 07:45 AM
Hello,
I  used the following script for open the radwindow from another radwindow. It is work but i want  to size(width,height) the window.
I can't unsertand how to set the size in this script.
 <telerik:RadScriptBlock runat="server" ID="test1_script">
    <script type="text/javascript">
        var test1Wnd;
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog       
            else if (window.frameElement && window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow; //IE (and Moz as well)       
            return oWindow;
        }
        function open_fromTest1() {
            var oBrowserWindow = GetRadWindow();
            if (oBrowserWindow) oBrowserWindow = oBrowserWindow.BrowserWindow;
            if (oBrowserWindow == null) {
                window.radopen("Default2.aspx" + "", "NewWindow1");
                
            }
            else {
                setTimeout(function() {
                    test1Wnd = oBrowserWindow.radopen("Default2.aspx", "NewWindow1");
                   
                }, 0);
            }
        }
    </script>
</telerik:RadScriptBlock>
and I used the RadButton:
<telerik:RadButton ID="cmdPrint" runat="server" SkinID="Button" AutoPostBack="false" Text="Print Prescription" OnClientClicked="open_fromTest1" />

I also added this: window.onresize(600, 1000);
It is not work.

Please help me as soon as possible.

Thanks and Regards
Jiten Mutum


1 Answer, 1 is accepted

Sort by
0
rdmptn
Top achievements
Rank 1
answered on 09 Apr 2012, 08:40 AM
You only need to use the RadWindow's client-side API: http://www.telerik.com/help/aspnet-ajax/window-programming-radwindow-methods.html. Once you have the reference (it is returned by radopen(), and you use it - the test1Wnd variable) you can use the setSize() method on it.

As for window.onresize - this is a standard browser event and what you have attached will result in a JavaScript error. It needs a function name or a variable of type function that will be its event handler, so you need to remove it. A RadWindow instance is not the same as the window object each browser frame has.
Tags
Window
Asked by
Jiten
Top achievements
Rank 1
Answers by
rdmptn
Top achievements
Rank 1
Share this question
or