jQuery DataTables - Access all rows data

前端 未结 4 422
既然无缘
既然无缘 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:32

    If you do this:

    $('#table').DataTable().rows().data(); 
    

    you get a lot of unnecessary data.

    If you just want the table data you can do this:

    $('#table').DataTable().rows().data().toArray();
    

提交回复
热议问题