Window won't open after calling "load" on an unrelated div.

2 posts, 1 answers
  1. Answer
    Javier
    Javier avatar
    20 posts
    Member since:
    Dec 2013

    Posted 10 Dec 2013 Link to this post

    I have a window on my page:

    @(Html.Kendo().Window()
        .Name("window")
        .Title("Add New Comment").LoadContentFrom("AddComment", "Comparisons", new { startDate = @ViewBag.startDate, endDate = @ViewBag.endDate })

        .Draggable()
        .Resizable()
        .Width(450).Height(500)
        .Position(settings => settings.Top(100).Left(100)).Visible(false).Modal(true).Iframe(true)
        .Actions(actions => actions.Close())
    )

    I open the window with a hyperlink, here is the binding:

            $("#addCommentLink").click(function () {
                $("#window").data("kendoWindow").refresh().open();
            });

    I have a div that's not related at all to the window.

    <div id='dummy'></div>

    At some point I load the div with a partial render.

    function ReloadCommentSection() {      
            $("#dummy").load('@Url.Action("CommentEventSection", new { startDate = @ViewBag.startDate, endDate = @ViewBag.endDate })');        
        }

    Once that div is loaded, the window won't open any more.  I get an error that  $("#window").data("kendoWindow") is undefined.


    What am I doing wrong?
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 12 Dec 2013 Link to this post

    Hello Buddy,

    I assume the partial view that you are loading again contains scripts such as jQuery. Check the troubleshooting guide:

    http://docs.kendoui.com/getting-started/troubleshooting#javascript-error-that-kendo-widgets-are-unavailable-or-undefined


    Regards,
    Petur Subev
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top