Get selected rows first column value in datatable

前端 未结 2 736
夕颜
夕颜 2021-01-18 03:42
$(\'.example tbody\').on(\'click\', \'tr\', function (){
    var id = this.id;
    var index = $.inArray(id, selected);
    if (index === -1) 
    {
    selected.pus         


        
2条回答
  •  猫巷女王i
    2021-01-18 04:16

    Guruprasad code (perfect) with small handy updates.

    var table= $('#YourTableName').DataTable();
    $('#button').click(function () {
               var arr = [];
               $.each(table.rows('.selected').data(), function() {
                   arr.push(this["ColomnName"]);
               });
    });
    

提交回复
热议问题