This is a migrated thread and some comments may be shown as answers.
Problem with form components when loading partial view containing form components
1 Answer 66 Views
This is a migrated thread and some comments may be shown as answers.
Dion
Top achievements
Rank 1
Veteran
Dion asked on 17 Aug 2020, 03:35 AM

I am using .net core mvc version

I have a partial view that I'm loading using a jquery .load

The partial contains a form, which contains some kendo dropdowns and a kendo editor

Whenever the load completes and the partial view renders in the target div, I see a console error relating to each of the kendo components

VM2091:1 Uncaught TypeError: jQuery(...).kendoDropDownList is not a function
    at <anonymous>:1:48
    at Object.n [as syncReady] (VM2083 kendo.aspnetmvc.min.js:25)
    at <anonymous>:1:7
    at DOMEval (jquery.js:111)
    at domManip (jquery.js:5762)
    at jQuery.fn.init.append (jquery.js:5898)
    at jQuery.fn.init.<anonymous> (jquery.js:5992)
    at access (jquery.js:3939)
    at jQuery.fn.init.html (jquery.js:5959)
    at Object.<anonymous> (jquery.js:9892)

 

 

When i pull out the code that failed and execute it in the browser console, it works and suddenly the kendo form components work fine again.

 

an example of the code thats failing is this line 

kendo.syncReady(function(){jQuery("#ClientId").kendoDropDownList({"autoBind":true,"dataTextField":"Text","dataValueField":"Value","optionLabel":"Select client...","value":"33526","filter":"contains","dataSource":{"transport":{"read":{"url":"/Client/ClientSelect_Read","data":function() { return kendo.ui.DropDownList.requestData(jQuery("#ClientId")); }},"prefix":""},"serverFiltering":true,"filter":[],"schema":{"errors":"Errors"}}});});

 

Can anyone tell me how to resolve this error?

 

 

1 Answer, 1 is accepted

Sort by
0
Dion
Top achievements
Rank 1
Veteran
answered on 17 Aug 2020, 04:38 AM
Sorry all, It was my mistake... In my controller I was returning View not PartialView... rookie mistake.
Asked by
Dion
Top achievements
Rank 1
Veteran
Answers by
Dion
Top achievements
Rank 1
Veteran
Share this question
or