您的位置:首页 > 其它

DataTables选择行并删除(删除单行)

2015-06-27 19:55 302 查看
$(document).ready(function() {
var table = $('#example').DataTable();

$('#example tbody').on( 'click', 'tr', function () {
if ( $(this).hasClass('selected') ) {
$(this).removeClass('selected');
}
else {
table.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
}
} );

$('#button').click( function () {
table.row('.selected').remove().draw( false );
} );
} );


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: