如何啓用劍道UI網格行的選擇。我使用HTML輔助函數創建一個劍道電網通過JavaScript訪問,並啓用了行selction,但沒有運氣代碼如下所示如何獲得劍道格行選擇
@(Html.Kendo().Grid((IEnumerable<Gridkendo.Models.Model>)Model)
.Name("grid")
.Columns(columns =>
{
// Create a column bound to the ProductID property
columns.Bound(product => product.Name);
// Create a column bound to the ProductName property
columns.Bound(product => product.Description);
和訪問它在JavaScript
<script>
$(function() {
// Notice that the Name() of the grid is used to get its client-side instance
var grid = $("#grid").data("kendoGrid");
var selectedItem = grid.dataItem(grid.select());
alert(selectedItem.ShipName);
});
</script>
這是選擇演示:http://demos.telerik.com/kendo-ui/grid/selection這裏是ASP.MVC GridBuilder API:HTTP ://docs.telerik.com/kendo-ui/api/aspnet-mvc/kendo.mvc.ui.fluent/gridbuilder#methods-Selectable – 2014-11-06 11:43:17