Skip to content

Expose Template Component Integration for Form Editors #8155

@alestoya

Description

@alestoya

Enhancement

Expose Template Component Integration for the Form's Editors.

Overview

Currently, in order to add additional markup around a given editor, it should be defined through the EditorTemplateHandler. It would be beneficial to be able to declare the Form's Editor via the Template Component.

Warning

Although the Template will practically allow the inclusion of any of the available components within the suite, it is important to take into consideration the following editors that allow built-in integration with the Form - https://docs.telerik.com/kendo-ui/api/javascript/ui/form/configuration/items#itemseditor

This would then enable the declaration of the form editor for a given item in the following manner:

@(Html.Kendo().Form<FormViewModel>()
    .Name("form")
    .Items(items =>
    {
        items.Add()
            .Field(f => f.Username)
            .Label(l => l.Text("Username:"))
            .Editor(e => Html.Kendo().Template()
                    .AddHtml(@<text>
                        <span class="error-message"></span>
                    </text>)
                    .AddComponent(component => component
                        .TextBox()
                        .Name("Username")
                    )
            );

    })
)

This enhancement can also be considered a CSP Improvement as it will support scenarios such as the Global Deferring.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions