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

Close window when clicking outside

2 Answers 404 Views
Window
This is a migrated thread and some comments may be shown as answers.
Faustino
Top achievements
Rank 1
Faustino asked on 11 Oct 2014, 04:11 PM
Hi.

how close window when clicking outside?, when my window is modal because my window is out of my page and the title bar is not visible to close

thanks!

2 Answers, 1 is accepted

Sort by
0
Faustino
Top achievements
Rank 1
answered on 11 Oct 2014, 04:52 PM
Thanks and I could solve it

  <script type="text/javascript">
         //Codigo
         function pageLoad() {
             $addHandler(document, "click", onClickHandler);
         }
         var lastOpenedWindow;
         function onClickHandler(e) {
             var targedNodeName = e.target;

             //if (lastOpenedWindow && (targedNodeName != clickedButton)) {
             // If the RadWindow is clicked then do nothing ;
             //if($telerik.isMouseOverElementEx(
             lastOpenedWindow = $find("<%=RadWindow1.ClientID%>");
            if ($telerik.isMouseOverElementEx(lastOpenedWindow.get_popupElement(), e)) return;

            lastOpenedWindow.close();
            lastOpenedWindow = null;
            clickedButton = null;
            //}
        }

    </script>
0
Faustino
Top achievements
Rank 1
answered on 11 Oct 2014, 04:52 PM
Thanks and I could solve it  :)

  <script type="text/javascript">
         //Codigo
         function pageLoad() {
             $addHandler(document, "click", onClickHandler);
         }
         var lastOpenedWindow;
         function onClickHandler(e) {
             var targedNodeName = e.target;

             //if (lastOpenedWindow && (targedNodeName != clickedButton)) {
             // If the RadWindow is clicked then do nothing ;
             //if($telerik.isMouseOverElementEx(
             lastOpenedWindow = $find("<%=RadWindow1.ClientID%>");
            if ($telerik.isMouseOverElementEx(lastOpenedWindow.get_popupElement(), e)) return;

            lastOpenedWindow.close();
            lastOpenedWindow = null;
            clickedButton = null;
            //}
        }

    </script>
Tags
Window
Asked by
Faustino
Top achievements
Rank 1
Answers by
Faustino
Top achievements
Rank 1
Share this question
or