阅读背景:

在datatable中获取选定行的第一列值

来源:互联网 
$('.example tbody').on('click', 'tr', function (){
    var id = this.id;
    var index = $.inArray(id, selected);
    if (index === -1) 
    {
    selected.push(id);
    } else 
    {
    selected.splice(index, 1);
    }
    $(this).toggleClass('selected');
});
$('#btn').click(function (){
    var dataArr = [];
    var rowCount = table.rows('.selected').data().length;
    alert(rowCount);
});
$('.example tbody').on('click', 'tr', function 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: