繁体   English   中英

如何使用Jquery在MVC中进行分页时从Kendo Grid UI中获取复选框选择的行值

[英]how to get the checkbox selected row values from Kendo Grid UI while pagination in MVC using Jquery

在使用Jquery在MVC中进行分页时,如何从Kendo Grid UI中获得复选框选择的行值,

分页时从Kendo Grid UI选中复选框选择的行值

我已经按照上面的链接完成了我的工作,我可以获取当前页面选择的行值,但不能获取所有页面选择的行值。请您帮帮我,如何获取所有选中的复选框行值甚至是分页。 例如:第一页我选择2行,第二页我选择2行意味着当单击4行按钮时,该行将传递给控制器​​,请帮助。

您可以使用PersistSelection功能使它正常工作,如此演示中所示: https ://demos.telerik.com/aspnet-mvc/grid/checkbox-selection

比您可以通过以下方式获取行值:

$('#btnSave').click(function (e){
    var grid = $("#grid1").data("kendoGrid");

    grid.selectedKeyNames().forEach(function (id) {
        console.log(grid.dataSource.get(id).ProductID);
    });
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM