Hello community!
I have a problem with my grid and the popup-editing feature.
In my popup there is another grid which needs the email address from the selected row from parent grid (to get the right data in the child grid).
I already tried the "grid.dataItem(grid.select())"-Function. But its return false.
Maybe I misunderstand the problem.
This is my Main-Grid:
@(Html.Kendo().Grid<NPHE2016Management.Models.MailboxViewModel>()
.Name("mailboxes")
.Columns(columns =>
{
columns.Bound(c => c.mailboxID).Hidden();
columns.Bound(c => c.upn).Hidden();
columns.Bound(c => c.mailboxType);
columns.Bound(c => c.firstName);
columns.Bound(c => c.lastName);
columns.Bound(c => c.email);
columns.Bound(c => c.mailboxSize).Title("Mailbox Größe (MB)");
columns.Command(command => { command.Edit().Text(" "); command.Destroy().Text(" "); }).Width(150);
})
.ToolBar(toolbar => toolbar.Create())
.HtmlAttributes(new { style = "height: 550px;" })
.Scrollable()
.Sortable()
.Selectable(x => x.Mode(GridSelectionMode.Single))
.Editable(editable => editable
.Mode(GridEditMode.PopUp)
.TemplateName("MailboxTemplate")
.Window(window => window.Width(1000).HtmlAttributes(new { style = "width:700px;" }))
)
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(p => p.mailboxID))
.Read(read => read.Action("MailboxRead", "Home"))
.Create(update => update.Action("MailboxCreate", "Home")).Events(ev => ev.Error("onErrorMailbox"))
.Update(update => update.Action("MailboxUpdate", "Home")).Events(ev => ev.Error("onErrorMailbox"))
.Destroy(update => update.Action("MailboxDelete", "Home")).Events(ev => ev.Error("onErrorMailbox"))
.PageSize(20)
)
.Events(e =>
{
e.Edit("onEdit");
e.Remove("onRemove");
e.Change("onRowChange");
})
)
Thank you very much.
Best regards
Patrick