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

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

1 Answer 74 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jonathan Travis
Top achievements
Rank 1
Jonathan Travis asked on 10 Dec 2013, 05:06 PM
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?

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 12 Dec 2013, 10:59 AM
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!
Tags
Window
Asked by
Jonathan Travis
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or