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

Client API - Initial Behaviors

1 Answer 74 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jason Heine
Top achievements
Rank 1
Jason Heine asked on 05 Nov 2010, 02:30 PM
Hello,

I am opening the rad window via radopen:

No matter what setting I put in the window manager, it does not want to use those settings. Any thoughts on how I can open my rad window and use the settings via the window manager?

I really need to set initial behaviors and other properties, but can't find it in the client side api documentation.


function ShowAddForm() {
            var window = radopen("AddAction.aspx?CID=<%= HttpUtility.UrlEncode(Request["CID"]) %>", "AddActionDialog");
            window.setSize(800, 600);
            window.SetModal(true);
            window.center();

            return false;
        }
function ShowAddForm() {
            var window = radopen("AddAction.aspx?CID=<%= HttpUtility.UrlEncode(Request["CID"]) %>", "AddActionDialog");
            window.setSize(800, 600);
            window.SetModal(true);
            window.center();
 
            return false;
        }

I have my RadWindowManager:

<telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    EnableShadow="true" Behaviors="Close" KeepInScreenBounds="True"
    ReloadOnShow="True" ShowContentDuringLoad="False" VisibleStatusbar="False"
    VisibleTitlebar="False">
    <Windows>
        <telerik:RadWindow ID="AddActionDialog" runat="server" Title="Add New Action" Height="800"
            Width="600" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" />
    </Windows>
</telerik:RadWindowManager>

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 10 Nov 2010, 12:53 PM
Hi Jason,

The JavaScript code should work (I would only suggest to change the modal method to set_modal() to match the ASP.NET AJAX naming convention). As for opening a declared RadWindow and the properties that you have set in its declaration not being set, this can happen if you have more than 1 RadWindowManagers on the page.

In such case, you need to take into consideration the following:

   1. All RadWindowManager's functions (radopen, radalert, radconfirm, radprompt, GetRadWindowManager, etc) are always using the first rendered RadWindowManager on the page.
   2. Every RadWindowManager "knows" only the RadWindows that are declared in its Windows collection.

This means that if you have a RadWindow2 declared in RadWindowManager2, and you use something like radopen(myUrl, "RadWindow2");, radopen will use RadWindowManager1 and will open a new RadWindow with the settings taken from RadWindowManager1. To avoid that problem, when you have multiple managers on a page, you need to get a reference to the correct RadWindowManager first and then call its methods.
e.g.
var manager = $find("<%= RadWindowManager2.ClientID %>");
manager.open(myUrl, "RadWindow2");




Kind regards,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
Jason Heine
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or