This is a migrated thread and some comments may be shown as answers.
setSize does not work
1 Answer 23 Views
This is a migrated thread and some comments may be shown as answers.
Hee
Top achievements
Rank 1
Hee asked on 06 Jan 2012, 01:36 AM
Hello

I want to change modal window size dynamically.
So I using setSize client method. But it does not work. Is there something wrong with my code?
Here is my javascript code.
function RadButtonNew_OnClientClicked() {
    var oManager = GetRadWindowManager();
    var windowClientID = "RadWindowTest";
    var oWnd = oManager.getWindowById(windowClientID);
 
    oWnd.setUrl("./Test.aspx");
    oWnd.set_title("New");
    oWnd.set_reloadOnShow(true);
 
    oWnd.show();
    var popupWidth = $telerik.$(window).width() * 0.8;
    var popupHeight = $telerik.$(window).height() * 0.8;
 
    oWnd.setSize(popupWidth, popupHeight);
    oWnd.center();
     
    return false;
}

aspx
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" AutoSize="false"
            Modal="false" VisibleTitlebar="true" Width="600" Height="400" MinWidth="600" MinHeight="400" Behaviors="Close, Move, Resize"
            VisibleStatusbar="false" Skin="Default" ShowContentDuringLoad="false" ReloadOnShow="false"
            Style="position: absolute; z-index: 7000;" RestrictionZoneID="RadPaneContents"
            OnClientBeforeClose="RadWindowManager1_OnClientBeforeClose" OnClientClose="RadWindowManager1_OnClientClose"
            OnClientShow="RadWindowManager1_OnClientShow" OnClientDragEnd="ResizeSplitterWrap">
            <Windows>
                <telerik:RadWindow ID="RadWindowTest" runat="server" />
            </Windows>
        </telerik:RadWindowManager>


I did set AutoSize="true" but it does not work too.
In some case, even when I did set number not percentage, it does not work too.
For example, setSize(1250, 700)
set_width and SetWidth do not work too.
I really don't know why it does not work.
What is the problem?

Hee

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 06 Jan 2012, 05:18 AM
Hello,

Try the following.
JS:
var width=oWnd.get_width()*0.8;
var hght=oWnd.get_height()*0.8;
oWnd.setSize(width,hght );

Thanks,
Princy.
Asked by
Hee
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or