选中/突出显示复选框上的整行

时间:2015-06-18 09:46:04

标签: javascript jquery datatables

我想选择数据表的整行。使用以下代码,仅选择数据中的第0个(NAME)列:

我在成功的ajax函数中执行以下操作

mydtable.DataTable( {
    aaData:result.users,
    "aaSorting": [[1,'asc']],
    "iDisplayLength": 25,
    "bPaginate": true,
    "sPaginationType": "full_numbers",
    "scrollY":"350px",
    "scrollCollapse": true,
    "order": [ 1, 'asc' ],
    "dom": 'T<"clear">lfrtip',
    "oTableTools": {
        "sRowSelect":   'multi',
        "sRowSelector": 'td:first-child',
        "aButtons": [ 'select_all', 'select_none', ]
    },

    "aoColumns":
        [
            { "data": null, defaultContent: '', orderable: false},
            { "mData": 0 },
            { "mData": 1 },
            { "mData": 2 },
        ],

});

1 个答案:

答案 0 :(得分:1)

看一下这个演示 - http://live.datatables.net/kesijisi/1 - 这就是你想要的吗?