0
我目前面臨的問題是Kendo UI網格視圖同時使用ClientRowTemplate和ColumnMenu。Kendo GridView在同一時間使用ClientRowTemplate和ColumnMenu不起作用
@(Html.Kendo().Grid<ByCompanyParticipants>()
.Name("grdParticipantsList")
.Columns(cols =>
{
cols.Bound(bcp => bcp.IsAssigned)
.Width(40)
.Title("Assigned")
.Sortable(false)
.Groupable(false)
.Filterable(false)
.HeaderHtmlAttributes(new { @class = "thGreenGridColumnHeader" })
.HeaderTemplate("<div class='divParticipantsCheckAll'>" +
"<form class='frmParticipantsCheckAll'>" +
"<input id='chkParticipantsCheckAll' type='checkbox' onclick='ToggleParticipantCheckBoxes()' />" +
"</form>" +
"</div>");
cols.Bound(bcp => bcp.CompanyName)
.Title("Company")
.HeaderHtmlAttributes(new { @class = "thGreenGridColumnHeader" });
cols.Bound(bcp => bcp.FirstName)
.Title("First Name")
.HeaderHtmlAttributes(new { @class = "thGreenGridColumnHeader" });
cols.Bound(bcp => bcp.LastName)
.Title("Last Name")
.HeaderHtmlAttributes(new { @class = "thGreenGridColumnHeader" });
cols.Bound(bcp => bcp.Title)
.Title("Position")
.HeaderHtmlAttributes(new { @class = "thGreenGridColumnHeader" });
cols.Bound(bcp => bcp.City)
.Title("City")
.HeaderHtmlAttributes(new { @class = "thGreenGridColumnHeader" });
cols.Bound(bcp => bcp.MSO)
.Title("MSO")
.HeaderHtmlAttributes(new { @class = "thGreenGridColumnHeader" });
cols.Bound(bcp => bcp.UserID)
.Title("User Role")
.Filterable(false)
.Sortable(false)
.Groupable(false)
.HeaderHtmlAttributes(new { @class = "thGreenGridColumnHeader" });
cols.Bound(bcp => bcp.UserID)
.Title("Co-Owner")
.Width(84)
.Filterable(false)
.Sortable(false)
.Groupable(false)
.HeaderHtmlAttributes(new { @class = "thGreenGridColumnHeader" });
})
.ClientRowTemplate(
"<tr class='byUserParticipantRow'>" +
"#=InjectParticipantGridGroupCells()#" +
"<td>" +
"<div class='divParticipantsCheckBox'>" +
"<form>" +
"<input id='chkParticipant#:UserID#' type='checkbox' class='chkParticipantsCheckBox' onclick='ToggleParticipantCheckBox(#:UserID#)' #:(IsAssigned != null && IsAssigned) ? 'checked=\"true\"' : \"\"# />" +
"</form>" +
"</div>" +
"</td>" +
"<td class='trGridRow'>" +
"#:CompanyName#" +
"</td>" +
"<td class='trGridRow'>" +
"#:FirstName#" +
"</td>" +
"<td class='trGridRow'>" +
"#:LastName#" +
"</td>" +
"<td class='trGridRow'>" +
"#=(Title == null ? '' : Title)#" +
"</td>" +
"<td class='trGridRow'>" +
"#=(City == null ? '' : City)#" +
"</td>" +
"<td class='trGridRow'>" +
"#=(MSO == null ? '' : MSO)#" +
"</td>" +
"<td>" +
"<div class='divParticipantUserRole'>" +
"</div>" +
"</td>" +
"<td>" +
"<div class='divIsParticipantCoOwner'>" +
"<form>" +
"<input class='chkIsParticipantCoOwner' type='checkbox' />" +
"</form>" +
"</div>" +
"</td>" +
"</tr>"
)
.DataSource(ds =>
{
ds.Ajax()
.Read(read =>
{
read.Action("GetProjectParticipants", "ProjectConfiguration")
.Data("GetProjectParticipantParameters");
})
.ServerOperation(false);
})
.Events(e =>
{
e.DataBound("OnByUserParticipantGridDataBound");
})
.Filterable()
.ColumnMenu()
.Groupable()
.HtmlAttributes(new { style = "height: 285px;" })
.Scrollable()
.AutoBind(false)
.Selectable(se => se.Mode(GridSelectionMode.Single))
.Sortable()
)
下面是我在做複製問題的步驟:
A.遵守有關網格視圖的列和標題的列表。
B.收起使用柱菜單的複選框欄(左側第一列)。
C.小組由來自該列表的列(X姓,名,公司名等),並注意到這是早期隱藏使用列菜單複選框欄再次可見,儘管它的頭不存在。