when set "bDestroy":true, i try to recreate the datatable, it will request twice to my server.
when set "bDestroy":true, i try to recreate the datatable, it will request twice to my server.
chris_zhang
Posts: 1Questions: 0Answers: 0
hi, Allan , i'm trying to use datatable, i meet an issue.
i set "bDestroy":true, the first time i create the datatable, it will request the server once. but when i recreate the datatable, it will request the server twice.
the datatable version is 1.8.2
this is my code.
[code]
start time
end time
choose brand
roewe
benz
create table
var get_url;
function change_url(){
var starttime = $("#starttime").val();
var endtime = $("#endtime").val();
var brand = $('#brand').val();
get_url = 'interface_js/getFirstCallin.php?starttime='+starttime+"&endtime="+endtime+"&brand="+brand;
var oTable = $('.datatable').dataTable( {
"bJQueryUI": true,
"sScrollX": "",
"bSortClasses": false,
"aaSorting": [[0,'asc']],
"bAutoWidth": true,
"bInfo": true,
"sScrollY": "100%",
"sScrollX": "100%",
"bScrollCollapse": true,
"sPaginationType": "full_numbers",
"bProcessing":true,
"bServerSide": false,
"bDestroy":true,
"sAjaxSource": get_url,
"aoColumns": [
{"sTitle": "callin time","mDataProp": "opertime" },
{ "sTitle": "user phone","sClass": "center","mDataProp": "user_phone" },
{ "sTitle": "equipment num","mDataProp": "eqid" },
{"sTitle": "token","mDataProp": "sid" }
]
} );
}
[/code]
i set "bDestroy":true, the first time i create the datatable, it will request the server once. but when i recreate the datatable, it will request the server twice.
the datatable version is 1.8.2
this is my code.
[code]
start time
end time
choose brand
roewe
benz
create table
var get_url;
function change_url(){
var starttime = $("#starttime").val();
var endtime = $("#endtime").val();
var brand = $('#brand').val();
get_url = 'interface_js/getFirstCallin.php?starttime='+starttime+"&endtime="+endtime+"&brand="+brand;
var oTable = $('.datatable').dataTable( {
"bJQueryUI": true,
"sScrollX": "",
"bSortClasses": false,
"aaSorting": [[0,'asc']],
"bAutoWidth": true,
"bInfo": true,
"sScrollY": "100%",
"sScrollX": "100%",
"bScrollCollapse": true,
"sPaginationType": "full_numbers",
"bProcessing":true,
"bServerSide": false,
"bDestroy":true,
"sAjaxSource": get_url,
"aoColumns": [
{"sTitle": "callin time","mDataProp": "opertime" },
{ "sTitle": "user phone","sClass": "center","mDataProp": "user_phone" },
{ "sTitle": "equipment num","mDataProp": "eqid" },
{"sTitle": "token","mDataProp": "sid" }
]
} );
}
[/code]
This discussion has been closed.