Tallan's Technology Blog

Tallan's Top Technologists Share Their Thoughts on Today's Technology Challenges

Kendo UI Window IE8 Error

Nick Rubino

While working on my most recent project using the Kendo UI Library I came across the following error when trying to inject html from a partial view into a Kendo UI Window.
SCRIPT5007: Unable to get property ‘top’ of undefined or null reference kendo.all.min.js, line 26 character 30328

This error would only occur in IE8 and not IE10, Chrome, or Mozilla.


The partial view is loaded through a jquery ajax call and inserted into the Kendo Window Div as follows:

            $.ajax({
                url: "@Url.Action("ACTION_TO_GET_PARTIAL_VIEW")",
                type: "POST",
                success: function (result) {
                    var kendoWindow = $("#KENDO_WINDOW_CONTAINER").kendoWindow({
                        title    : "WINDOW TITLE",
                        resizable: false,
                        modal    : true,
                        viewable : false
                    });
                    kendoWindow.data("kendoWindow").content(result).open().center();
                }
            });

I then realized the Div for the window was closing it self:

</pre>
<div id="KENDO_WINDOW_CONTAINER"></div>
<pre>

I changed the Div to the following and it now works correctly in IE8

</pre>
<div id="KENDO_WINDOW_CONTAINER"></div>
<pre>

Since Visual Studio’s HTML editor doesn’t seem to invalidate self closing Div tags it took me a little while to find this problem.

Hope this saves someone some time,
Nick

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

\\\