【发布时间】:2023-03-09 01:41:01
【问题描述】:
如何启用 kendo ui 网格行选择。我使用 html 辅助函数创建了一个剑道网格,通过 javascript 访问它并启用了行选择,但下面没有显示运气代码
@(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>
【问题讨论】:
-
这里是选择演示:demos.telerik.com/kendo-ui/grid/selection 这里是 ASP.MVC GridBuilder api:docs.telerik.com/kendo-ui/api/aspnet-mvc/kendo.mvc.ui.fluent/…
标签: jquery asp.net-mvc kendo-ui kendo-grid