//回调函数
queryStaticBattery_cb=function(result){
switchNum = 2;
let data=result.data.rows;
if (realData_DT!=null || realData_DT!="") {
realData_DT.draw();
} else{
//object可以如下初始化表格
realData_DT= $('#staticVehBatteryTable').DataTable( {
"dom":"<'row'<'col-sm-12'tr>>"+ "<'row'<'col-md-4'l><'col-md-4'i><'col-md-4'p>>",
"deferRender": true,
"processing": true,
"searching": false,
"serverSide": false,
"ordering": false,
"paging":true,
"pageLength": 10, //初始页面长度 (每页的行数)
"lengthMenu": [
[10, 20, 30, 40, 50],
[10, 20, 30, 40, 50]
], //每页显示条数列表的选项
"language": {
"lengthMenu": "每页显示 _MENU_ 条记录",
"zeroRecords": "没有符合条件的数据",
"info": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
"infoEmpty": "显示第 0 至 0 项结果,共 0 项",
"infoFiltered": "(从 _MAX_ 条数据中检索)",
"paginate": {
"first": "首页",
"previous": "上一页",
"next": "下一页",
"last": "尾页"
},
"aria": {
"sortAscending": ": 以升序排列此列",
"sortDescending": ": 以降序排列此列"
}
},
data:data,
//使用对象数组,一定要配置columns,告诉 DataTables 每列对应的属性
//data 这里是固定不变的,name,position,salary,office 为你数据里对应的属性
columns: [
{data: 'batteryIndex' },
{data: 'manuFacturerCode' },
{ data: 'batteryType',render: function( data, type, row) {
switch(data)
{
case -1: return "其它电池"; break;
case 1: return "磷酸铁锂"; break;
case 2: return "锰酸锂"; break;
case 3: return "钴酸锂"; break;
case 4: return "三元材料"; break;
case 5: return "聚合物锂离子"; break;
case 6: return "超级电容"; break;
case 7: return "钛酸锂"; break;
}
} },
{ data: 'power' },
{ data: 'voltage' },
{ data: 'updatedTime' }
]
} );
}
if($("#staticVehBatteryTable").DataTable()!=null){
$('#Modal').modal({keyboard:true,show:true});
/*window.parent.$('#parentDiv').empty();
window.parent.$('#parentDiv').append($('#childDiv').html());
window.parent.show(switchNum);
window.parent.$("#Modal #label").text("电池静态信息");*/
}
}
queryStaticBattery_cb=function(result){
switchNum = 2;
let data=result.data.rows;
if (realData_DT!=null || realData_DT!="") {
realData_DT.draw();
} else{
//object可以如下初始化表格
realData_DT= $('#staticVehBatteryTable').DataTable( {
"dom":"<'row'<'col-sm-12'tr>>"+ "<'row'<'col-md-4'l><'col-md-4'i><'col-md-4'p>>",
"deferRender": true,
"processing": true,
"searching": false,
"serverSide": false,
"ordering": false,
"paging":true,
"pageLength": 10, //初始页面长度 (每页的行数)
"lengthMenu": [
[10, 20, 30, 40, 50],
[10, 20, 30, 40, 50]
], //每页显示条数列表的选项
"language": {
"lengthMenu": "每页显示 _MENU_ 条记录",
"zeroRecords": "没有符合条件的数据",
"info": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
"infoEmpty": "显示第 0 至 0 项结果,共 0 项",
"infoFiltered": "(从 _MAX_ 条数据中检索)",
"paginate": {
"first": "首页",
"previous": "上一页",
"next": "下一页",
"last": "尾页"
},
"aria": {
"sortAscending": ": 以升序排列此列",
"sortDescending": ": 以降序排列此列"
}
},
data:data,
//使用对象数组,一定要配置columns,告诉 DataTables 每列对应的属性
//data 这里是固定不变的,name,position,salary,office 为你数据里对应的属性
columns: [
{data: 'batteryIndex' },
{data: 'manuFacturerCode' },
{ data: 'batteryType',render: function( data, type, row) {
switch(data)
{
case -1: return "其它电池"; break;
case 1: return "磷酸铁锂"; break;
case 2: return "锰酸锂"; break;
case 3: return "钴酸锂"; break;
case 4: return "三元材料"; break;
case 5: return "聚合物锂离子"; break;
case 6: return "超级电容"; break;
case 7: return "钛酸锂"; break;
}
} },
{ data: 'power' },
{ data: 'voltage' },
{ data: 'updatedTime' }
]
} );
}
if($("#staticVehBatteryTable").DataTable()!=null){
$('#Modal').modal({keyboard:true,show:true});
/*window.parent.$('#parentDiv').empty();
window.parent.$('#parentDiv').append($('#childDiv').html());
window.parent.show(switchNum);
window.parent.$("#Modal #label").text("电池静态信息");*/
}
}