Home > Web Front-end > JS Tutorial > body text

jquery dataTable method to get a certain row of data

小云云
Release: 2018-01-12 13:07:01
Original
4910 people have browsed it

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() );
} );
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!