This article mainly introduces the relevant knowledge of jquery dataTable to obtain a certain row of data, which has a good reference value. Let's take a look with the editor below, I hope it can help everyone.
DataTable API table.row(rowSelector[,modifier])
Note table is the object of dataTable
This method has two default parameters
The first is the selector and the second is optional
Please note that if the selector matches more than one row, this method will truncate the result to contain only One line, the first matching line. If there are no parameters return the first row.
When reading data, use table.row(rowSelector [, modifier]).data()
For example, double-click to get row data
var table = $('#example').DataTable(); $('#example tbody').on( 'click', 'tr', function () { console.log( table.row( this ).data() ); } );
Related recommendations:
jquery dataTable background loading data and paging
jQuery plug-in DataTables paging development technology Share
What to do if the Datatables header is not aligned
The above is the detailed content of jquery dataTable method to get a certain row of data. For more information, please follow other related articles on the PHP Chinese website!