简体   繁体   English

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

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

how to get the checkbox selected row values from Kendo Grid UI while pagination in MVC using Jquery, 在使用Jquery在MVC中进行分页时,如何从Kendo Grid UI中获得复选框选择的行值,

checkbox selected row values from Kendo Grid UI while pagination 分页时从Kendo Grid UI选中复选框选择的行值

I have followed the above link to get my work done, I can able to get the current page selected row values, but am not able to get all the page selected row values.can you pls help me , how to get all the checkbox selected row values even pagination also. 我已经按照上面的链接完成了我的工作,我可以获取当前页面选择的行值,但不能获取所有页面选择的行值。请您帮帮我,如何获取所有选中的复选框行值甚至是分页。 Ex: first page i'm selecting 2 row and the second page i'm selecting 2 row means when click of button 4 rows shoud get pass to the controller, pls help. 例如:第一页我选择2行,第二页我选择2行意味着当单击4行按钮时,该行将传递给控制器​​,请帮助。

You can get it working using the PersistSelection functionality as in this demo: https://demos.telerik.com/aspnet-mvc/grid/checkbox-selection 您可以使用PersistSelection功能使它正常工作,如此演示中所示: https ://demos.telerik.com/aspnet-mvc/grid/checkbox-selection

Than you can get the row values this way: 比您可以通过以下方式获取行值:

$('#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