我正在使用嵌套的kendo网格,我面临一个问题,这里的标题没有为子网格添加。
https://jsfiddle.net/seesqz9u/
儿童网格
<script id="ChidRowTemplate" type="text/kendo-tmpl">
@(Html.Kendo()
.Grid<Cirrus.Settings.Entities.Integration.DynamicImportChildJobs>()
.Name("SettingsChildRowGrid_#=MasterJobId#")
.Columns(columns =>
{
columns.Bound(o => o.ListActionIndex)
.Filterable(false)
.ClientTemplate("<div class='open-actions'><a href='' data-action='edit' title=" + CommonResource.LblEditRes + " class='k-grid-edit aux-icon icon16-white edit'></a><a href='' data-action='delete' onclick='return OnDeleteChildRecord(this,\"#=MasterJobId#\");' title=" + CommonResource.LblDeleteRes + " class='aux-icon icon16-white delete'></a><a href='' data-action='update' title= " + CommonResource.LblSaveRes + " class='k-grid-update aux-icon icon16-white save'></a><a href='' data-action='cancel' title=" + CommonResource.LblCancelRes + " class='k-grid-cancel aux-icon icon16-white cancel'></a></div>")
.Width(40)
.Sortable(false)
.Groupable(false)
.HtmlAttributes(new { @class = "bg-highlight" })
.HeaderHtmlAttributes(new { @class = "bg-highlight" });
columns.Bound(u => u.ChildJobId).Hidden(true).HtmlAttributes(new { id = "cJob" });
columns.Bound(u => u.SequenceNo).Title("Sequence").Width(30);
columns.Bound(u => u.ImportFunction).Title("Function").Width(100);
columns.Bound(u => u.ImportScriptName).Title("Script Name").Width(60);
columns.Bound(u => u.ImportUploadFolder).Title("Upload Folder").Width(60);
columns.Bound(u => u.ImportFileName).Title("Field Name").Width(60);
columns.Bound(u => u.ImportTemplateId).Title("Template Definition").Width(60);
columns.Bound(u => u.ParamValues).Title("Parameter").Width(60);
})
.ToolBar(toolbar =>
{
toolbar.Template(@<text>
<a class="icon24-black-circle add" id="lnkAddRecord" href="javascript:void(0);"
onclick="AddNewRecordChild(this);return false;"></a>
</text>);
})
.Editable(editable => editable.Mode(GridEditMode.InLine)
.CreateAt(GridInsertRowPosition.Bottom))
.DataSource(source =>
{
source.Ajax()
.Model(model =>
{
model.Field(m => m.ListActionIndex).Editable(false);
model.Field(m => m.SequenceNo).Editable(false);
})
.Read(read => read.Action("GetSettingsTransferChildData", "SettingsOfTransfer", new { mJobId = "#=MasterJobId#", ViewBag.RouteObjforUnitId }))
.Update(read => read.Action("UpdateSettingsTransferChildData", "SettingsOfTransfer", new { mJobId = "#=MasterJobId#", ViewBag.RouteObjforUnitId }))
.Create(read => read.Action("SaveSettingsTransferChildData", "SettingsOfTransfer", new { mJobId = "#=MasterJobId#", ViewBag.RouteObjforUnitId }))
.Model(model => model.Id(u => u.ChildJobId))
.PageSize(10)
.Events(e => e.Error("onError"));
})
.Events(e =>
{
e.DataBound("ChildRowGrid_DataBound");
})
.Selectable(s => s.Type(GridSelectionType.Row))
.Sortable()
.Groupable(groupable => groupable.Enabled(false))
.Resizable(resizable => resizable.Columns(true))
.Reorderable(reorderable => reorderable.Columns(true))
.Filterable()
.Scrollable(action => action.Enabled(true).Height("auto"))
.ToClientTemplate()
)
</script>