Expose EditorTemplateId and EditorTemplateView TagHelper attributes in the Form TagHelper.
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));
});
})
)
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>
At moment the Form Group does not support the HtmlAttributes() method. Is it possible to implement?
For example:
@(Html.Kendo().Form<Model>()
.Name("exampleForm")
...
.Items(items =>
{
items.AddGroup()
.HtmlAttributes(...)
.Items(i => {...});
})
)
The Kendo Form should include native ListBox editor support including joining and swapping items between two ListBox's using ConnectWith.
To use a ListBox in the Kendo Form currently requires a custom editor which is overly complex.
.Items(items => { items.Add() .Field(f => f.Type) .Label(l => l.Text("Type:")) .Editor(e => { e.Upload() } }
Provide built-in integration of RadioButton / RadioGroup in the Form
i.e. : .Editor(e =>Add support for hidden fields. There could be an alternative way of adding them to the Items collection, e.g.
.AddHidden()
Consider the cases when the hidden field is bound to a model field and when it isn't bound to the model. The latter could be a scenario involving antiForgeryTokens:
<input type="hidden" name="__RequestVerificationToken" value="token" />
In both cases you should be able to set the value of the hidden field programmatically and submit it with the form.