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

Loading and displaying a window based on menu selection

1 Answer 56 Views
Window
This is a migrated thread and some comments may be shown as answers.
michael
Top achievements
Rank 2
michael asked on 19 Dec 2011, 03:19 PM
I have a menu system that allows me to select an URL which I want to load into a window and then display it.

Here is my code:

    <script type="text/javascript">
        $(document).ready(function () {
            $("#menu").kendoMenu();
        });
    </script>


    <script type="text/javascript">
        $(document).ready(function () {
            $(".menu-dialog").click(function () {
                var href = $(this).attr("href");
                var title = $(this).attr("title");
                alert("Got Here: " + title +  ' => ' +  href);
                var myWin = $("#window").kendoWindow({
                    title: title,
                    width: "200px",
                    height: "200px",
                    modal: true,
                    visible: false,
                    content: href
                });


                myWin.open();
            });
        });
    </script>

The Menu function works correctly and the menu is displayed.

The function that is supposed to fire on menu selection fires correctly (The alert box is displayed), however the window is not displayed and the contents of the page pointed to by href is displayed.

any help would be appreciated.

Mike B.

1 Answer, 1 is accepted

Sort by
0
michael
Top achievements
Rank 2
answered on 19 Dec 2011, 04:00 PM
This works:

    <script type="text/javascript">
        $(document).ready(function () {
            $(".menu-dialog").click(function () {
                var href = $(this).attr("href");
                var title = $(this).attr("title");
                var myWin = $("#window").kendoWindow({
                    width: "200px",
                    height: "200px",
                    modal: false,
                    resizable: true,
                    title: title,
                    content: href
                });
                
                return false;
            });
        });
    </script>

NOTE: I removed the "visible: false" and the open statement.
Tags
Window
Asked by
michael
Top achievements
Rank 2
Answers by
michael
Top achievements
Rank 2
Share this question
or