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

Facing issue while closing RadWindow

2 Answers 60 Views
Window
This is a migrated thread and some comments may be shown as answers.
Nileshkumar
Top achievements
Rank 1
Nileshkumar asked on 29 Jul 2014, 01:59 PM
We are facing issue while closing the telerik rad window. In telerik rad window, we are doing updates and clicks on ‘Save’ button. At the same time clicks on window’s tab and drag the window. After sometime the rad window will pop-up but we are unable to close the window by clicking on ‘Cancel’ link or ‘Close’ icon.
On click of ‘Cancel’ button application is calling “CloseAndRebind” function to close the window. Code is written as mentioned below
function CloseAndRebind() {
                        GetRadWindow().Close();
                        GetRadWindow().BrowserWindow.RefreshBarcodeSettingRadGrid();
                    }
                    function GetRadWindow() {
                        var oWindow = null;
                        if (window.radWindow)
                            oWindow = window.radWindow; 
                        else if (window.frameElement.radWindow)
                            oWindow = window.frameElement.radWindow; 
                        return oWindow;
                    }
Same behavior we have observed in one of the demo of telerik rad window. 
URL of Telerik  rad window demo: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window
Steps to reproduce issue in demo URL
1. Click “Add New Record” link
2. Click on “Insert” button
3. At the same time drag the popup
4. New record will be inserted but pop-up will not closed, now click on “Cancel” button
Pop-up should be closed but it isn’t. We are facing the same issue.
Please do needful.

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 30 Jul 2014, 07:26 AM

Hello Nileshkumar,

This happens because when the user drops the mouse there is code that is supposed to execute which repaints the RadWindow. If it is already closed, it will be shown but the needed handlers will not be attached.

To avoid this, you have two options:

  • disable the Move and Resize behaviors (either from the markup, or dynamically, when the update/insert is initiated)
  • use the control's events to check if it is already closed when dragging/resizing ends and hide its popup if so. I am attaching a simple example of this approach here.

I hope this explains the case.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Rahul
Top achievements
Rank 1
answered on 23 Dec 2015, 02:23 PM

I now this post is older one but may help to some one else

Just need to modify your CloseAndRebind Method as follow

function CloseAndRebind(){         
      var oWnd=GetRadWindow();            
      if (!oWnd._popupVisible) {
           oWnd._popupVisible = true
         }
         oWnd.Close();
         oWnd.BrowserWindow.RefreshBarcodeSettingRadGrid();
       }

Tags
Window
Asked by
Nileshkumar
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Rahul
Top achievements
Rank 1
Share this question
or