Javascript 数据表:shift multi-select不工作
我正在使用Javascript 数据表:shift multi-select不工作,javascript,jquery,datatables,Javascript,Jquery,Datatables,我正在使用数据表1.10。我已经创建了一个表,但我无法对其行执行多个“shift-select” 根据DataTables文档: TableTools has four row selection modes of operation: none - Default, where no user row selection options are available single - A single row can be selected multi - Multipl
数据表1.10
。我已经创建了一个表,但我无法对其行执行多个“shift-select”
根据DataTables文档:
TableTools has four row selection modes of operation:
none - Default, where no user row selection options are available
single - A single row can be selected
multi - Multiple rows can be selected simply by clicking on the rows
os - Operating System like selection where you can use the shift and ctrl / cmd keys on your keyboard to add / remove rows from the selection.
因此,我创建了如下表:
$("#my-table-div").DataTable({
"retrieve": true,
"pagingType": "full_numbers",
"pageLength": 50,
"lengthMenu": [50, 100, 200],
"dom": '<lfi<t>p>',
"autoWidth": false,
"columns": columnsTable,
"tableTools": {
"sRowSelect": "os"
}
});
$(“#我的表div”).DataTable({
“检索”:正确,
“pagingType”:“完整编号”,
“页面长度”:50,
“长度菜单”:[50100200],
“dom”:“”,
“自动宽度”:false,
“columns”:columnsTable,
“表格工具”:{
“sRowSelect”:“操作系统”
}
});
正如您所看到的,我使用的是“sRowSelect”:“os”
,但它肯定不是我想要的。我无法让“轮班选择”工作
有没有关于我遗漏了什么或做错了什么的想法?这里有一个问题,您需要添加数据表。选择.min.js
ressource来管理选择选项。您的选项:“columns”:columnsTable
有问题
$(document).ready(function() {
$('#example').DataTable( {
"retrieve": true,
"pagingType": "full_numbers",
"pageLength": 50,
"lengthMenu": [50, 100, 200],
"dom": '<lfi<t>p>',
"autoWidth": false,
//"columns": columnsTable, <-- options problem
"select": {
"style": "os"
}
} );
} );
$(文档).ready(函数(){
$('#示例')。数据表({
“检索”:正确,
“pagingType”:“完整编号”,
“页面长度”:50,
“长度菜单”:[50100200],
“dom”:“”,
“自动宽度”:false,
//“columns”:columnsTable,如果您使用的是datatables 1.10,那么您根本不应该使用TableTools;这是按钮和select的1.10之前的扩展。您应该使用select扩展,文档化的“columns”:columnsTable
不一定是问题,只要它们在初始化表之前定义了语法正确的对象。