Dynamically created Kendo Window is undefined

5 posts, 0 answers
  1. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 04 Mar 2013 Link to this post

    Hello,

    I am trying to dynamically create a Kendo Window but the resulting object always comes back undefined for some reason. I am trying to initialize the new window using $('<div />').appendTo(document.body) as the container. The window seems to get created correctly at first - it opens and loads the remote content inside (via Ajax), however, the returned object (container.data('kendoWindow')) is always undefined. Please take a look at the following jsFiddle and inspect the debug logs in the console:

    http://jsfiddle.net/obry/2sthT/2/

    Thank you
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 05 Mar 2013 Link to this post

    Hello Vesselin,

    The problem with the example is the name configuration option. On the server, it specifies the window id. However, on the client-side, it specifies the data property on which the client-side object is attached. If you want to specify an ID, you can set it as an attribute to the initial div. See the updated fiddle.

    Regards,
    Alex Gyoshev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 06 Mar 2013 Link to this post

    Hi Alex,

    Thanks for your input and although that does work in jsFiddle, the same code does not work with my own solution (element is still undefined) and also when I tried it inside jsBin (http://jsbin.com/eraqat/1) I get the same result: wnd is undefined. In my solution we are using jquery 1.9.1 and kendo 2012.3.1413. Unfortunately when I try to include jquery 1.9.1 in either jsBin or jsFiddle, I get the same generic error that the property 'msie' is not defined when the example tries to first load hence why I am using jquery 1.8.3 instead. 

    If you can take a look at the jsBin example and if you can tell why it is behaving differently than the jsFiddle that would be great. In the meanwhile I will try to create a VS project to reproduce the issue with the exact same library versions that I am using and send you guys a support ticket (or post it here; whichever works better for you).

    Thank you
  5. Vesselin Obreshkov
    Vesselin Obreshkov avatar
    81 posts
    Member since:
    Jan 2010

    Posted 06 Mar 2013 Link to this post

    Hello,

    Please find a sample solution that shows the explained behavior when using jQuery 1.9.1 and Kendo MVC 2012.3.1413. The files to note are ~/Scripts/application.js and ~/Views/Home/Index.cshtml.

    Thank you

    P.S. I also just tried the same with the latest Kendo beta (2013.1.226) but still the same result
  6. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 07 Mar 2013 Link to this post

    Hello Vesselin,

    To work with the client-side object, do not set the name configuration option when initializing the editor on the client-side. Here is the updated fiddle.

    Regarding the jQuery version, we do not support jQuery 1.9.1 yet. Please use 1.8.2 until we claim to support 1.9.x (probably in Q1).

    All the best,
    Alex Gyoshev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready