我要求在一列中显示带有数据的下拉列表,在其他列中我需要显示复选框列表。如何显示天气可以使用客户端模板或模板。 (我需要在页面加载中显示,用户应该选择没有编辑的选项。)
@(Html.Kendo().Grid(Model.listItems)
.Name("Grid")
.TableHtmlAttributes(new { @class = "table-responsive table table-bordered table-scrollable table-hover table-striped dataTable", style = "" })
.BindTo(Model.listItems)
.DataSource(data => data
.Ajax()
.Model(
m =>
{
m.Field(esc => esc.List1);
m.Field(esc => esc.List2);
}
)
.Create(create => create.Action("DecisionsAndRoeles", "Admin")) //Dummy action
)
.Columns(columns =>
{
columns.Bound(p => p.List1).Title("Role").Template(@<text></text>).HtmlAttributes(new { @class = "templateCell" }).ClientTemplate(Html.Kendo().DropDownList()
.Name("RoleSets")
.OptionLabel("Please Select")
.BindTo("#=List1#")
.DataTextField("Description")
.DataValueField("RoleId").ToClientTemplate()
.ToHtmlString()
).Width(200);//"#=generateTemplate(ListRoles)#");//.ClientTemplate(ruleSetDropDown.ToString());
columns.Bound(p => p.List2).Title("Decision Options").ClientTemplate
("<div class='col-lg-11'>" +
"<div class='row' style='margin-top:2px>" +
"<div class='row'>" +
"<div class='row'>" +
"</div>" +
"<div class='col-md-12' >" +
"#for(var i=0; i<List2.Count;i++)" +
"{#" +
"<div class='col-md-6'>" +
"<div class='col-md-6'>" +
"<input type='checkbox' class='chkDecisionOption' id='chkDecisionOpt' onchange='checkboxClick(this)' value='test' name='test' /> List2[i].Description" +
"</div>" +
"<div class='col-md-6'>" +
"</div>" +
"</div>" +
"#}#" +
" </div>" +
" </div> " +
"</div>" +
"</div>");
}
)
.Pageable()
.Sortable()
.Scrollable()
.ToolBar(commands => commands.Create()).Events(e => { e.DataBound("gridDecisionDataBound"); })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Model(model => model.Id(p => p.id))
)
)
问题:下拉数据以及其他未填充的列数据。