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

Overriding Radwindow default style using js

3 Answers 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jesse
Top achievements
Rank 1
Veteran
Jesse asked on 18 May 2020, 03:19 PM

I am trying to override the default  style of a radwindow using js...I see this is simple to do in the code behind, but I need a way to do it on the front end as well. This is what i've tried.

 

var radWindow = $find("<%=RadWindowManager1.ClientID%>").Open(null,null);
          radWindow.setSize(640, 480);
            radWindow._cssClass =  " customClass";
            radWindow.set_title("Fubar");
            radWindow.setActive(true);
            radWindow.SetModal(true);
            radWindow.center();
         
            radWindow.set_visibleStatusbar(false)
            radWindow.set_keepInScreenBounds(true);

 

The window opens but the custom class isn't applied. Thanks in advance for any suggestions.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 21 May 2020, 11:27 AM

Hi Jesse,

Here is an example of how to set the class on the wrapper via JavaScript:

        <style>
            .customClass { border: 1px solid red !important; }
        </style>
        <asp:Button ID="Button1" Text="show the dialog" OnClientClick="showDialog(); return false;" runat="server" />
        <telerik:RadWindow RenderMode="Lightweight" runat="server" ID="RadWindow1"></telerik:RadWindow>
        <script type="text/javascript">
            function showDialog() {
                var wnd = $find("<%= RadWindow1.ClientID%>");
                wnd.show();
                var windowWrapper = $get("RadWindowWrapper_" + wnd.get_id());
                windowWrapper.className += " customClass";
            }
        </script>

 

Regards,
Rumen
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Jesse
Top achievements
Rank 1
Veteran
answered on 23 May 2020, 02:54 PM

Hi Rumen,

 

Thanks! I just tested your and it works.

0
Rumen
Telerik team
answered on 26 May 2020, 07:12 AM

You are welcome, Jesse! Keep up the good work and stay safe!

Regards,
Rumen
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Jesse
Top achievements
Rank 1
Veteran
Answers by
Rumen
Telerik team
Jesse
Top achievements
Rank 1
Veteran
Share this question
or