datatables 行点击事件
来源:互联网 发布:域名注册排行榜 编辑:程序博客网 时间:2024/06/09 19:04
这是官网上的方法,但是我用着没效果。
$(document).ready(
function
() {
var
table = $(
'#example'
).DataTable();
$(
'#example tbody'
).on(
'click'
,
'tr'
,
function
() {
var
data = table.row(
this
).data();
alert(
'You clicked on '
+data[0]+
'\'s row'
);
} );
} );
这是我找到的另外一种方法,可以得到想要的效果
$(document).ready(
function
() {
var
table =
$('#table tbody tr').DataTable();
$('#table tbody tr').
live('click', function() {
var
data = table.row(
this
).data();
alert(
'You clicked on '
+data[0]+
'\'s row'
);
} );
} );
阅读全文
0 0
- datatables 行点击事件
- JQuery datatables 将符合条件的单元格设置特殊背景,添加点击事件
- datatables 行元素事件翻页后失效问题
- datagrid 行点击事件
- datatables动态添加列事件
- GridView点击行触发事件
- jqgrid 触发行点击事件
- 解决DataTables ColVis自动draw()事件
- DataTables-对最后一列添加按钮事件
- datatables 行内修改
- DataTables
- datatables
- datatables
- Datatables
- datatables
- datatables
- DataTables
- 点击事件
- 钱币兑换问题 HDU 1284
- 安装Linux虚拟机
- 万能数据类型QVariant类
- 分析微信小程序的登录和支付
- Hive性能优化
- datatables 行点击事件
- Xamarin.forms动画菜单案例(一)
- 数组排序
- 面试OR笔试43——走迷宫
- GreenDao
- button test0
- 拥有什么成绩才算是成功的微商从业者
- springboot redis shiro的后台管理模板
- drawablw