【发布时间】:2017-05-16 06:41:49
【问题描述】:
我正在使用 jquery 数据表来显示数据。让我显示 id、name、pass 和控件。在 id,name,pass 数据中显示,但在每一行的控件中都有一个按钮。
我只想在单击按钮时获取行信息。我知道在整行中单击时如何获取数据或特定行。但我只想在按钮点击中获取信息。
单击行本身时,我使用以下代码显示行。
$('#example tbody').on( 'click', 'tr', function () {
console.log( table.row( this ).data() );
} );
【问题讨论】:
-
$('#tb tbody').on('click', 'tr', function () { console.log( table.row( this ).data() ); } );
-
请参考以下链接解决您的问题:stackoverflow.com/questions/29191760/…
-
这并不能解决我的问题
-
@Scott 看看This Answer
标签: jquery datatables