Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.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
如何在jquery datatable中为每个函数获取行的父子级_Jquery_Asp.net Mvc_Jquery Datatables - Fatal编程技术网

如何在jquery datatable中为每个函数获取行的父子级

如何在jquery datatable中为每个函数获取行的父子级,jquery,asp.net-mvc,jquery-datatables,Jquery,Asp.net Mvc,Jquery Datatables,我已经实现了jquerydatatable。在单击按钮时,我必须从表中获取所有选定的行数据,为此,我向每一行添加了“SelectedRow”类。我的代码是 $("#frmSubmitCSVProduct").live('submit', function (e) { e.preventDefault(); var Barcodes = ""; oTable = $('#tblCsvUPCList').dataTable();

我已经实现了jquerydatatable。在单击按钮时,我必须从表中获取所有选定的行数据,为此,我向每一行添加了“SelectedRow”类。我的代码是

 $("#frmSubmitCSVProduct").live('submit', function (e) {
        e.preventDefault();
        var Barcodes = "";

        oTable = $('#tblCsvUPCList').dataTable();


        $.each(oTable.fnGetData(), function (i, row) {
            alert(row);
            });
});
我得到了警告 44848448,第4项,第3项,第4项,第30项,著名项目,啤酒

bui我只需要选定行的数据,该行已选定类 可不可以选择所选行

<tr id="tr35841256" data-barcode="35841256" style="cursor: pointer;" class="SelectedRow">
<td class=" sorting_1">35841256</td>
<td class="">item no. 4</td>
<td class="">item3,item4</td>
<td class=""><input type="button" value="Select" id="btnSelectProduct" class="btn"></td></tr>

35841256
项目4
项目3、项目4

我只想从我的表中选择这一行,另一个字段被隐藏,我如何才能做到这一点

此链接可能也有助于提醒这些值,因为它位于for each的内部。将警报移到for循环之外<代码>警报($(this.find(“.yourCellIdHere”).html())