Close window when clicking outside

3 posts, 0 answers
  1. Faustino
    Faustino avatar
    6 posts
    Member since:
    Mar 2014

    Posted 11 Oct 2014 Link to this post

    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. Faustino
    Faustino avatar
    6 posts
    Member since:
    Mar 2014

    Posted 11 Oct 2014 Link to this post

    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>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Faustino
    Faustino avatar
    6 posts
    Member since:
    Mar 2014

    Posted 11 Oct 2014 Link to this post

    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>
Back to Top