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

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

I have this datatable setup:

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


        
2条回答
  •  南旧
    南旧 (楼主)
    2021-02-03 12:39

    I did the following:

     oTable = $('#RectifiedCount').dataTable( ....);
    
     $('#RectifiedCount tbody tr').live('click', function (event) {        
        var aData = oTable.fnGetData(this); // get datarow
        if (null != aData)  // null if we clicked on title row
        {
            //now aData[0] - 1st column(count_id), aData[1] -2nd, etc. 
        }
    });
    

提交回复
热议问题