Kendo window with template is producing TS error (TypeError: e.toLowerCase is not a function)

1 Answer 55 Views
Window
Brian
Top achievements
Rank 2
Iron
Brian asked on 31 Jul 2024, 06:11 PM

I have a Kendo window:

$("#depDialog").kendoWindow({
    width: "450px",
    modal: true,
    title: "Add Dependency",
    content: {
        template: $('#javascriptTemplate').html()
    },
    visible: false,
    resizable: false,
    actions: [
        { text: "Cancel" },
        { text: "Add", primary: true }
    ]
});

I also have a template:

<script id="javascriptTemplate" type="text/x-kendo-template">
     <div class="row mt-2">
        <div class="col">
            @(Html.Kendo().DropDownList()
                .Name("dep_new")
                .DataTextField("Name")
                .DataValueField("Id")
                .BindTo((System.Collections.IEnumerable)(Model.Applications.ToList()))
                .SelectedIndex(0)
                .ToClientTemplate()
            )
        </div>
        <div class="col">
            @(Html.Kendo().TextBox()
                .Name("dep_notes_new")
                .HtmlAttributes(new { style = "height: 38px;" })
                .ToClientTemplate()
            )
        </div>
    </div>
</script>

I have an empty div to load the template:

<div id="depDialog"></div>

I tried using a dialog (hence the naming) but I couldn't get it to work.  Now I'm using a window, and I'm getting the following TS error:

kendo.all.js:96132  Uncaught TypeError: e.toLowerCase is not a function
    at kendo.all.js:96132:1
    at Function.map (jquery-3.7.0.min.js:2:3967)
    at init._actions (kendo.all.js:96130:1)
    at init.title (kendo.all.js:96540:1)
    at new init (kendo.all.js:95806:1)
    at HTMLDivElement.<anonymous> (kendo.all.js:3741:1)
    at Function.each (jquery-3.7.0.min.js:2:3129)
    at ce.fn.init.each (jquery-3.7.0.min.js:2:1594)
    at e.fn.<computed> [as kendoWindow] (kendo.all.js:3740:1)
    at init.editOnShow (index.ts:287:29)

The error line points to the kendoWindow initialization.  Thoughts?

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 05 Aug 2024, 12:09 PM

Hello, Brian,

The Window doesn't have "actions" configuration. Please remove that from the code for the component in order to avoid the error.

Let me know how that goes.

Regards,
Martin
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

Brian
Top achievements
Rank 2
Iron
commented on 06 Aug 2024, 02:19 PM

Hi Martin,

Unfortunately, the error persists after removing the 'actions' as well.

I'm going to use the default grid edit instead of a custom popup window to edit to resolve.

Thanks,
Brian C.

Tags
Window
Asked by
Brian
Top achievements
Rank 2
Iron
Answers by
Martin
Telerik team
Share this question
or