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
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