CheckBoxFor throws exception

1 Answer 39 Views
Checkbox
kva
Top achievements
Rank 2
Iron
Iron
Iron
kva asked on 07 Aug 2023, 08:14 AM | edited on 07 Aug 2023, 11:09 AM
4032:46 Uncaught TypeError: jQuery(...).kendoCheckBox is not a function
    at HTMLDocument.<anonymous> (4032:46:169)
    at i (jquery.min.js:2:27466)
    at Object.fireWith [as resolveWith] (jquery.min.js:2:28230)
    at Function.ready (jquery.min.js:2:30023)
    at HTMLDocument.K (jquery.min.js:2:30385)

This is my code:

@model DMDPace.DataAccess.DomainModels.Project;

<div style="margin: 20px">
    <h3>Project: @Model.ProjectName</h3>
    <br/>
    <div style="display: flex">
        <h3 style="margin-right: 15px">Manager: </h3>

        @(Html.Kendo().DropDownListFor(x => x.ProjectManagerId)
            .DataTextField("DisplayName")
            .DataValueField("Id")
            .Events(e =>
            {
                e.Select("managerChange");
            })
            .DataSource(source =>
            {
                source.Read(read =>
                {
                    read.Action("FilterEmployees", "Home");
                });
            })
            .HtmlAttributes(new { style = "width: 15%; min-width: 280px;" }))
    </div>
    <div style="display: flex; align-items: center;">
        <h3 style="margin-right: 15px">Is Active: </h3>
    
        @(Html.Kendo().CheckBoxFor(x => x.IsActive))
    </div>
</div>

DropDownListFor renders correctly, but checkBoxFor doesn't.

Project:

    public class Project : Entity
    {
        public string ProjectName { get; set; }
        public bool IsActive { get; set; }
        
        public int? ProjectManagerId { get; set; }
        public virtual User ProjectManager { get; set; }
    }

1 Answer, 1 is accepted

Sort by
1
Accepted
Mihaela
Telerik team
answered on 09 Aug 2023, 12:46 PM

Hello,

Usually, such error occurs when:

Since the DropDownList editor is rendered correctly at your end, I suspect that the issue may be caused by a discrepancy between the installed NuGet package version and the referenced client-side resources. Would you please ensure that the versions of both the client-side resources (scripts and styles) and the corresponding Telerik UI for ASP.NET Core NuGet package match?


 

Regards, Mihaela Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Tags
Checkbox
Asked by
kva
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Mihaela
Telerik team
Share this question
or