Problem with form components when loading partial view containing form components

2 posts, 0 answers
  1. Dion
    Dion avatar
    7 posts
    Member since:
    May 2020

    Posted 16 Aug 2020 Link to this post

    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?



  2. Dion
    Dion avatar
    7 posts
    Member since:
    May 2020

    Posted 16 Aug 2020 in reply to Dion Link to this post

    Sorry all, It was my mistake... In my controller I was returning View not PartialView... rookie mistake.
Back to Top