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

Dynamically created Kendo Window is undefined

4 Answers 654 Views
Window
This is a migrated thread and some comments may be shown as answers.
Vesselin Obreshkov
Top achievements
Rank 2
Vesselin Obreshkov asked on 04 Mar 2013, 07:17 PM
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

4 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 05 Mar 2013, 08:14 AM
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!
0
Vesselin Obreshkov
Top achievements
Rank 2
answered on 06 Mar 2013, 04:19 PM
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
0
Vesselin Obreshkov
Top achievements
Rank 2
answered on 06 Mar 2013, 04:37 PM
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
0
Alex Gyoshev
Telerik team
answered on 07 Mar 2013, 07:35 AM
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!
Tags
Window
Asked by
Vesselin Obreshkov
Top achievements
Rank 2
Answers by
Alex Gyoshev
Telerik team
Vesselin Obreshkov
Top achievements
Rank 2
Share this question
or