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

Kendo UI-Integration in ASP.Net MVC 3 Project failed - kendo... not supported

3 Answers 111 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sven
Top achievements
Rank 1
Sven asked on 02 Apr 2013, 03:26 PM
Dear KendoUI-Team!
I tried to integrate Kendo UI in our existing ASP.NET MVC 3 application. I carefully followed the instructions I found in the web:
- I added kendo.mvc to the project references
- I added the kendo css files
- I also added the kendo javascript files. I placed them in a subfolder of the Script folder.

"...
<script src="@Url.Content("~/Scripts/kendoui/jquery.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/kendoui/kendo.web.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/kendoui/kendo.aspnetmvc.min.js")" type="text/javascript")"></script>
.."
There are no other jquery script includes!

- I made the described changes in web.config in the views folder. I get code completion for kendo ui in my cshtml files.

BUT:
KendoUI does not work at all. The kendo... (e.G. kendoGrid) methods are not available.
Could yoi give me any further hints to investigate the problem. Her are some points that may help
- I put a breakpoint in the dynamic HTML code in the line where the kendo... function is called. The function is called twice. the first time the kendo... function is available. The second time it is not an the error is raised
- This is how my dynamic HTML looks like:
"
<div class="k-widget k-grid" id="di2"><table cellspacing="0"><colgroup><col /></colgroup><thead class="k-grid-header"><tr><th class="k-header" data-field="Rid" data-title="ItemRid" scope="col"><span class="k-link">ItemRid</span></th></tr></thead><tbody><tr class="t-no-data"><td colspan="1"></td></tr></tbody></table></div><script>
jQuery(function(){jQuery("#di2").kendoGrid({"columns":[{"title":"ItemRid","field":"Rid","filterable":{},"encoded":true}],"scrollable":false,"autoBind":false,"dataSource":{"transport":{"prefix":"di2-","read":{"url":""}},"serverPaging":true,"serverSorting":true,"serverFiltering":true,"serverGrouping":true,"serverAggregates":true,"type":"aspnetmvc-server","filter":[],"schema":{"data":"Data","total":"Total","errors":"Errors","model":{"fields":{"Rid":{"type":"number"},"ArtNoSupplier":{"type":"string"},"ArtNoClient":{"type":"string"},"ItemCurrency":{"type":"string"},"CommCD":{"type":"string"},"CoPref":{"type":"string"},"Unit":{"type":"string"},"FTLOrigin":{"type":"string"},"DescriptionSupplier":{"type":"string"},"CoPEMs":{"type":"string"},"VersionNr":{"type":"number"},"PosNr":{"type":"number"},"Price":{"type":"number"},"PricePer":{"type":"number"},"WeightGross":{"type":"number"},"WeightPer":{"type":"number"},"PemUndefined":{"type":"boolean"},"NoPem":{"type":"boolean"},"HasEUPref":{"type":"boolean"}}}}}});});
</script>
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("ReadDeclarationItems", "Le")))

)
"

If you need any further information please inform me.

brgds
Sven Weiberg

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 04 Apr 2013, 03:30 PM
Hello Sven Weiberg,

The scripts are correctly included. Could you provide the full code for the view and the layout or a small runnable sample so I can check the complete setup?

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Sven
Top achievements
Rank 1
answered on 08 Apr 2013, 01:46 PM
Ok, I found the solution for this problem.
I have to deactivate jquery at the srciptregistrar

@(Html.Telerik().ScriptRegistrar().Globalization(true).jQuery(false))    

Now the kendo... functions are always known

But(!):

Now the Telerik Controls are missing a bunch of propertys and objects:
Hier is a small list of undefined property errors I receive
- browser.version, browser,mozilla, browser.msie (as browser is removed)
- 'Sys' is undefined (when trying to access Sys.Mcv.FormContext)
- srcipts (in b.scripts.push)

How can I handle this?
0
Daniel
Telerik team
answered on 10 Apr 2013, 10:59 AM
Hello Sven,

The Telerik MVC Extensions are using jQuery 1.7.1 and the latest official Kendo release requires jQuery 1.9 in which there were a few breaking changes that could cause the described problems. If you need to use both the extension and Kendo in the same view then I can suggest to use an older version of Kendo. The Q2 2012 release was the last to use this version. 

Regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Sven
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Sven
Top achievements
Rank 1
Share this question
or