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

Close Radwindow and refresh page

2 Answers 369 Views
Window
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 19 Mar 2014, 08:10 PM
I have followed this code before and for different things I was doing it worked fine.  But in this situation I am stumped on how to tie it all in.  On my radwindow close when I press the x i wna the window to close and then the page to refresh.  I tried calling the close window function inside the pagerefresh but it doe snot work.  I can call one or the other  but not both.  If I just call the pageRefresh it leaves a white space on page before it refreshes and looks tacky, So I figure if I can close it then refresh the page it should looke good.
<telerik:RadWindowManager ID="rwManager" runat="server" CenterIfModal="true" Modal="true" Animation="FlyIn" Behaviors="Close" Skin="Web20"  ReloadOnShow="true" VisibleStatusbar="false" OnClientClose="RefreshParentPage">
              <Windows>
                  <telerik:RadWindow ID="rwdelete" runat="server" NavigateUrl="~/MAC/Delete.aspx" Width="600px" Height="300px" ShowContentDuringLoad="false"></telerik:RadWindow>
                  <telerik:RadWindow ID="rwChange" runat="server" NavigateUrl="~/MAC/Change.aspx" Width="800px" Height="600px" ShowContentDuringLoad="false"></telerik:RadWindow>
                  <telerik:RadWindow ID="rwNew" runat="server" NavigateUrl="~/MAC/NewUser.aspx"></telerik:RadWindow>
              </Windows>
          </telerik:RadWindowManager>
 
 
 
function GetRadWindow() {
           var oWindow = null;
           if (window.radWindow) oWindow = window.radWindow;
           else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
           return oWindow;
       }
 
       function closeWindow() {
           var oWnd = GetRadWindow();
           oWnd.close();
       }
 
       function RefreshParentPage() {
           document.location.reload();
       }






2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Mar 2014, 04:47 AM
Hi Kevin,

Please have a look into this article which deals the same scenario. Let me know if you have any concern.

Thanks,
Shinu.
0
Kevin
Top achievements
Rank 1
answered on 21 Mar 2014, 05:25 PM
<telerik:RadWindow ID="rwdelete" runat="server" NavigateUrl="~/MAC/Delete.aspx" Width="600px" Height="300px" ShowContentDuringLoad="false" CssClass="rwWindowContent" OnClientClose="RefreshParentPage"></telerik:RadWindow>
Hi Shinu,

they are posting back from server side, which i do in so situations and it works great.  In this one I am just closing the existing radWindow via the x on the radwindow,   I do not need the postback buttons bacuas eof hte way the page works, but i need the radgrid on the main page to refresh after i close the window.  I put tired the example on the page and it is how I have it except for the last statement.  I change it but it still dow not refresh the page, it closes the window but no refresh.  If I just call the refreshpage with out closing the window it does it but it leaves a window that is white before it refreshes and looks tacky.




function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            return oWindow;
        }
 
        function closeWindow() {
            var oWnd = GetRadWindow();
            oWnd.close();
        }
 
        function RefreshParentPage() {
            GetRadWindow().BrowserWindow.location.reload();
        }



Tags
Window
Asked by
Kevin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Kevin
Top achievements
Rank 1
Share this question
or