Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 3 从jqgrid的行获取rowID_Asp.net Mvc 3_Jqgrid_Checkbox_Jqgrid Asp.net - Fatal编程技术网

Asp.net mvc 3 从jqgrid的行获取rowID

Asp.net mvc 3 从jqgrid的行获取rowID,asp.net-mvc-3,jqgrid,checkbox,jqgrid-asp.net,Asp.net Mvc 3,Jqgrid,Checkbox,Jqgrid Asp.net,在我的asp.netmvc3应用程序中,我使用Jqgrid作为我的网格。它包含一个复选框,我管理事件如下 $("#list").find('input[type=checkbox]').live('change', function () { if ($(this).is(':checked')) { var _row = $(this).parent().parent(); } }); 我使用$(this.parent

在我的
asp.netmvc3
应用程序中,我使用
Jqgrid
作为我的网格。它包含一个复选框,我管理事件如下

 $("#list").find('input[type=checkbox]').live('change', function () {
                if ($(this).is(':checked')) {
                    var _row = $(this).parent().parent();
}
});

我使用
$(this.parent().parent()
获取行的id。我怎样才能拿到身份证?有没有什么方法请分享

这应该可以做到:

$('#list').find('input[type=checkbox]').live('change', function () {
    if ($(this).is(':checked')) {
        var row = $(this).parent().parent();
        var rowId = row.attr('id');
    }
});

如果您正在使用jqGrid的
idPrefix
选项的默认值(为空字符串),否则id将以该选项的值作为前缀。

在选择行上,您可以获得所选行的id。事实上,当您选中复选框时,您也会选择一行,因此:

onSelectRow: function(id){
yourId = $("#yourGrid").jqGrid('getGridParam', 'selrow');
alert("The id of checked row is: "+yourId);
}
id是指
标记的
id
属性还是某些列中包含的某些信息(
)?如果标记为id,则为id属性。或者,实际上我想要jqgrid行的id,我认为可以通过获取