jQuery DataTables - Access all rows data

前端 未结 4 416
既然无缘
既然无缘 2021-02-04 06:51

I\'m using jQuery DataTables and want to copy all rows (save in JavaScript array) upon clicking the header checkbox.

I want to find where jQuery DataTab

4条回答
  •  有刺的猬
    2021-02-04 07:47

    I find the generated element by jQuery DataTables using this code, and I can copy the whole tr element that hides when paging the DataTables.

    $('#example').DataTable().rows().iterator('row', function(context, index){
        var node = $(this.row(index).node()); 
        //node.context is element of tr generated by jQuery DataTables.
    });
    

提交回复
热议问题