Completed
Last Updated: 24 Jun 2024 06:52 by ADMIN
Release 2024 Q3 (Aug)
Piotr
Created on: 17 Jun 2024 07:13
Category: Form
Type: Feature Request
1
Expose EditorTemplateId and EditorTemplateView TagHelper attributes in the Form TagHelper

Overview

Expose EditorTemplateId and EditorTemplateView TagHelper attributes in the Form TagHelper.

Current behavior

Currently, the Telerik UI for ASP.NET Core Form TagHelper does not expose EditorTemplateId and EditorTemplateView TagHelper attributes. In comparison to its HTML Helper counterpart:

@(Html.Kendo().Form<FormItemsViewModels>()
    .Name("exampleForm")
    .FormData(Model.Form)
    .HtmlAttributes(new { action = "Items", method = "POST" })
    .Validatable(v =>
    {
        v.ValidateOnBlur(true);
        v.ValidationSummary(vs => vs.Enable(true));
    })
    .Items(items =>
    {
        items.AddGroup()
            .Label("Registration Form")
            .Items(i =>
            {
               i.Add()
                     .Field(f => f.TextBox)
                     .Label(l => l.Text("TextBox:"))
                     .EditorTemplateId("myTemplate");

                i.Add()
                     .Field(f => f.TextBox)
                     .Label(l => l.Text("TextBox:"))
                     .EditorTemplateView(Html.Partial("_ExportCalculationForm", Model.Form));
            });
    })
)

Expected/desired behavior

It would be beneficial if such configurations were to be exposed for the TagHelper Form as well

<kendo-form name="exampleForm"  method="POST" asp-action="Items" form-data="Model.Form">
    <validatable validate-on-blur="true" validation-summary="true" />
    <form-items>
        <form-item type="group">
            <item-label text="Registration Form" />
            <form-items>
                
                <form-item field="TextBox" editor-template-id="myTemplate">
                    <item-label text="TextBox:" />
                </form-item>

                <form-item field="TextBox" editor-template-view='Html.Partial("_ExportCalculationForm", Model.Form)'>
                    <item-label text="TextBox:" />
                </form-item>

            </form-items>
        </form-item>
    </form-items>
</kendo-form>

Environment

  • Kendo UI version: 2024.2.514
  • Browser: [all]
0 comments