I am using kendo grid popup editor with a template.
.Editable(c => { c.TemplateName("_CustomTemplate").Mode(GridEditMode.PopUp); })
This is the _CustomTemplate i am using
@model Models.CustomViewModel
<div id="popupeditor">
@Html.HiddenFor(model => model.Id)
<button type="button" id="NewEmailButton">Add New Email</button>
</div>
And the template model is
public class CustomViewModel
{
public string Name { get; set; }
public List<string> EmailList { get; set; } = new List<string>();
}
User can add new input for email by clicking the "Add New Email" button. I am adding the input to PopUp container with javascript.
function AddEmail()
{
let index = 0;
let input = '<input name="EmailList[index]" type="text"/>'
$(input).appendTo('#popupeditor');
}