@model Nop.Plugin.Misc.FruitBankPlugin.Areas.Admin.Models.TestGridModel @using DevExtreme.AspNet.Mvc @Html.AntiForgeryToken()
@( Html.DevExtreme().DataGrid() .ID("orderDataGridContainer") .ShowBorders(true) .DataSource(ds => ds.Mvc() .Controller("ManagementPage") .LoadAction("GetShippingDocuments")) .KeyExpr("Id") .SearchPanel(sp => sp.Visible(true)) .HeaderFilter(hf => hf.Visible(true)) .Paging(p => p.PageSize(15)) .Pager(p => p.Visible(true)) .OnRowExpanded("onRowExpanded") .Editing(editing => { editing.Mode(GridEditMode.Cell); editing.AllowUpdating(true); editing.AllowAdding(true); editing.AllowDeleting(true); }) .Columns(c => { c.Add().DataField("Id").AllowEditing(false); c.Add().DataField("Partner.Name").AllowEditing(false); c.Add() .Caption("Items in order") .DataType(GridColumnDataType.Number) .CalculateCellValue("calculateItemsCount").AllowEditing(false); c.Add().DataField("PartnerId"); c.Add().DataField("DocumentIdNumber"); c.Add().DataField("IsAllMeasured"); c.Add() .Caption("Completed") .DataType(GridColumnDataType.Boolean) .CalculateCellValue("calculateCellValue").AllowEditing(false); }) .Toolbar(toolbar => { toolbar.Items(items => { items.Add() .Name("addRowButton") .ShowText(ToolbarItemShowTextMode.Always); items.Add() .Location(ToolbarItemLocation.After) .Widget(w => w.Button() .Text("Delete Selected Records") .Icon("trash") .Disabled(true) .OnClick("onDeleteBtnClick") ); }); }) .MasterDetail(md => md.Enabled(true).Template(new TemplateName("masterDetailTemplate"))) )
@using (Html.DevExtreme().NamedTemplate("masterDetailTemplate")) {
<%- data.ShippingDate %> <%- data.LicencePlate %>'s shipping documents:
@if (Model.ChildGrids != null && Model.ChildGrids.Any()) {
@if (Model.Configuration.ShowChildGridsAsTabs) {
@for (int i = 0; i < Model.ChildGrids.Count; i++) { var child = Model.ChildGrids[i]; var isActive = i == 0 ? "show active" : "";
@* Initial load - will be replaced by AJAX on first tab click *@
Loading...
}
}
} }