Datatable hide and show rows based on a button click event

前端 未结 2 1395
感情败类
感情败类 2021-01-31 05:16

So I have this datatable that is generated by php dynamically once. But once it\'s loaded, I don\'t want to reload the whole table since there\'s only a small javascript if stat

2条回答
  •  鱼传尺愫
    2021-01-31 05:46

    According to this https://datatables.net/examples/plug-ins/range_filtering.html it is possible to use data parameter to filter by any value shown on the table.

    $("button").click(function() {
        $.fn.dataTable.ext.search.push(
          function(settings, data, dataIndex) {
              return data[3] != "63";
            }
        );
        table.draw();
    });  
    

提交回复
热议问题