当勾选复选框时,我如何防止用户一次只检查一条记录。目前用户可以勾选多条记录。请指教,谢谢
@(Html.Kendo().Grid<TRC.Models.ProductModel>()
.Name("Product")
.HtmlAttributes(new { @Style = "align:center; font-size:12px; width:470px; height:100%" })
.Columns(columns =>
{
columns.Template(p => p.Id).ClientTemplate("<input type='checkbox' class='chkbx'/> ").Width(25);
columns.Bound(p => p.ProductId).Width(220);
columns.Bound(p => p.ProductName).Width(220);
columns.Bound(p => p.ProductCreateDate).EditorTemplateName("Date").Format("{0:dd/MM/yyyy}").Width(120);
//columns.Command(commands => commands.Edit()).Width(100);
columns.Command(commands => commands.Destroy());
})
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Sortable()
.Selectable()
.Scrollable(scrollable => scrollable.Virtual(true))
.ColumnMenu(c => c.Columns(false))
.DataSource(dataSource => dataSource
.Ajax()//bind with Ajax instead server bind
.ServerOperation(true)
.Model(model =>
{
model.Id(p => p.ProductId);
model.Field(p => p.ProductCreateDate).DefaultValue(DateTime.Now);
model.Field(p => p.ProductCreateDate).Editable(false);
})
.Sort(sort => sort
.Add(x => x.ProductCreateDate).Descending()
)
.Read(read => read.Action("GetProduct", "ProductDetails").Type(HttpVerbs.Get))
.Destroy("DeleteProduct", "ProductDetails")
)
)