-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
C: FormEnhancementFP: UnplannedSync status with associated Feedback ItemSync status with associated Feedback ItemS: Wrappers (ASP.NET Core)
Description
The FormItemBuilder exposes an EditorTemplateView method which allows a view to represent the item and provides the entire modal to the view.
As the elements available to forms are limited to those hard coded by Telerik and whilst extension methods can be employed to expand this limitation slightly, the ability to create a context specific view would be ideal
The current implementation looks like this
Html.Kendo().Form<Model>()
.Items(items =>
{
items.AddGroup("Test", 1, 10)
.Items(i =>
{
i.Add().Field(x => x.Username)
i.Add().Field(x => x.Password).EditorTemplateView(Html.Partial("MyView"))
}
);
})
In this example, the entire model is provided into MyView.
I suggest adding an EditorTemplateFor that uses the lamda expression provided in the Field() method such as
Html.Kendo().Form<Model>()
.Items(items =>
{
items.AddGroup("Test", 1, 10)
.Items(i =>
{
i.Add().Field(x => x.Username)
i.Add().Field(x => x.Password).EditorTemplateViewFor(Html.Partial("MyView"))
}
);
})
Using the convention I would expect MyView to be provided the Password field only
Metadata
Metadata
Assignees
Labels
C: FormEnhancementFP: UnplannedSync status with associated Feedback ItemSync status with associated Feedback ItemS: Wrappers (ASP.NET Core)