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

[Solved] Integrating a Kendo UI window in an ASP.Net MVC website

1 Answer 292 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Julien
Top achievements
Rank 1
Julien asked on 04 Jan 2012, 11:41 AM
Hi,

I didn't found any KendoUI forum, so I will post this here.

I've some trouble integrating the KendoUI windows into an Asp.Net website. It's not directly related to asp.Net MVC.

I've taken the test code, and modified it a little: I need that the content is loaded when I open the windows(dynamic content, which can have changed between the page load and the open click):

<!-- Window HTML -->
<div style="display:none"  id="window"></div>
 
<!-- open button -->
<span id="undo" class="k-group">Click here to open the window.</span>
 
<script>
    $(document).ready(function () {
        $("#undo").bind("click", function () {
            //Getting the window
            var window = $("#window");
             
            //Loading the window
            window.kendoWindow({
                width: "500px",
                title: "Kendo Window",
                content: "/WindowsTest/AjaxContent"
            });
 
            //Displaying the window
            window.data("kendoWindow").open();
        });
    });
</script>

I also have added all required JS files in the layout. I checked manually, all these filepath are right:
<link href="@Url.Content("~/Content/KendoUI/kendo.common.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/KendoUI/kendo.default.css")" rel="stylesheet" type="text/css" />
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/KendoUI/kendo.core.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/KendoUI/kendo.fx.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/KendoUI/kendo.draganddrop.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/KendoUI/kendo.resizable.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/KendoUI/kendo.window.js")" type="text/javascript"></script>


But I get this error: Uncaught TypeError: Object [object Object] has no method 'kendoWindow' 

Why this? What am I missing? Seems like the library isn't well imported?

Thank you!


EDIT: I think I found the problem. I was having a 
@(Html.Telerik().ScriptRegistrar().Globalization(true).DefaultGroup(group => group.Combined(true).Compress(true)))

To register telerik scripts, and I think that it re-declare jQuery and then erase extension made to the first loaded jQuery extension.

Putting this before seems to work.

How should I do if I want to use the last jQuery version? Should I still use this scriptRegistrar? It's because of some telerik for asp.Net MVC components I'm using.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 04 Jan 2012, 02:23 PM
Hi,

 You can disable the jQuery which the ScriptRegistrar includes automatically:

ScriptRegistrar().jQuery(false)

 The Kendo UI forums are here: http://www.kendoui.com/forums.aspx 

Greetings,
Atanas Korchev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
General Discussions
Asked by
Julien
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or