0

i have implemented jquery datatable. on button click i have to get all selected row data from table and for this i have added "SelectedRow" class to each row. my code is

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

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


        $.each(oTable.fnGetData(), function (i, row) {
            alert(row);
            });
});

in alert i got "44848448,item no. 4,item3,item4,30,famous item,Beer,"

bui i want just data of selected row, which has selected class may selected row is

<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>

i just want this selected row from my table, another fields are hidden, how can i do this

Abhijit Pandya
  • 705
  • 2
  • 12
  • 33
  • this link might help [link](http://stackoverflow.com/questions/18109821/how-to-get-the-selected-table-cell-value-in-datatable) – bumbumpaw Jun 25 '14 at 09:44
  • also those values had been alerted because its inside your for each. move your alert outside the for loop. `alert($(this).find(".yourCellIdHere").html());` – bumbumpaw Jun 25 '14 at 09:48

0 Answers0