how to capture the data in a selected row using jQuery DataTables

前端 未结 2 925
醉酒成梦
醉酒成梦 2021-02-03 12:00

I have this datatable setup:

$(document).ready(function() {
    $(\'#RectifiedCount\').dataTable( {
        "bJQueryUI": true,
        "bProcessing         


        
2条回答
  •  滥情空心
    2021-02-03 12:40

    Mutch better way instead of hooking a click event, using just jquery and TableTools:

    "oTableTools": {
    "sRowSelect": "single",
    "fnRowSelected": function(node) {
        var row = $(node).find('td');
        //all cells
        $.each(row, function(index, td) {
            console.log($(td).text());
        });
    
        console.log("Specific cell content: " + $(row[2]).text());
    
    }
    

    }

提交回复
热议问题