FnClearTable(0)
FnClearTable(0)
ankita
Posts: 1Questions: 0Answers: 0
Hi, I am trying to use fnClearTable(0).
[code]
if (typeof oTable1 == 'undefined') {
oTable1 =$("#myTable").dataTable({
"aLengthMenu" : [[ 9, 27, 50, -1 ],[ 9, 27, 50, "All" ] ],
iDisplayLength : 9,
"bAutoWidth" : false,
"sPaginationType" : "full_numbers",
"bJQueryUI" : true,
"sDom" : '<"H"Tlfr>t<"F"ip>',
"oTableTools" : {
"aButtons" : [ "copy", "csv", "pdf" ],
"sSwfPath" : "/abc/ext/jquery/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
},
"bDestroy":true,
"aaSorting": [[ 0, "desc" ]],
"aoColumns": [
{ "sWidth": "25%" },
{ "sWidth": "25%" },
{ "sWidth": "10%" },
{ "sWidth": "10%" },
{ "sWidth": "15%" },
{ "sWidth": "10%" },
{ "sWidth": "5%" }
]
});
}
else
{
oTable1.fnClearTable(0);
$("#myTable").dataTable({
"aLengthMenu" : [[ 9, 27, 50, -1 ],[ 9, 27, 50, "All" ] ],
iDisplayLength : 9,
"bAutoWidth" : false,
"sPaginationType" : "full_numbers",
"bJQueryUI" : true,
"sDom" : '<"H"Tlfr>t<"F"ip>',
"oTableTools" : {
"aButtons" : [ "copy", "csv", "pdf" ],
"sSwfPath" : "/abc/ext/jquery/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
},
"bDestroy":true,
"aaSorting": [[ 0, "desc" ]],
"aoColumns": [
{ "sWidth": "25%" },
{ "sWidth": "25%" },
{ "sWidth": "10%" },
{ "sWidth": "10%" },
{ "sWidth": "15%" },
{ "sWidth": "10%" },
{ "sWidth": "5%" }
]
});
}
[/code]
Now In the else case fnClearTable function is not working sometimes. I cannot figure out that sometimes its working and sometimes its not working. please Help
[code]
if (typeof oTable1 == 'undefined') {
oTable1 =$("#myTable").dataTable({
"aLengthMenu" : [[ 9, 27, 50, -1 ],[ 9, 27, 50, "All" ] ],
iDisplayLength : 9,
"bAutoWidth" : false,
"sPaginationType" : "full_numbers",
"bJQueryUI" : true,
"sDom" : '<"H"Tlfr>t<"F"ip>',
"oTableTools" : {
"aButtons" : [ "copy", "csv", "pdf" ],
"sSwfPath" : "/abc/ext/jquery/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
},
"bDestroy":true,
"aaSorting": [[ 0, "desc" ]],
"aoColumns": [
{ "sWidth": "25%" },
{ "sWidth": "25%" },
{ "sWidth": "10%" },
{ "sWidth": "10%" },
{ "sWidth": "15%" },
{ "sWidth": "10%" },
{ "sWidth": "5%" }
]
});
}
else
{
oTable1.fnClearTable(0);
$("#myTable").dataTable({
"aLengthMenu" : [[ 9, 27, 50, -1 ],[ 9, 27, 50, "All" ] ],
iDisplayLength : 9,
"bAutoWidth" : false,
"sPaginationType" : "full_numbers",
"bJQueryUI" : true,
"sDom" : '<"H"Tlfr>t<"F"ip>',
"oTableTools" : {
"aButtons" : [ "copy", "csv", "pdf" ],
"sSwfPath" : "/abc/ext/jquery/extras/TableTools/media/swf/copy_csv_xls_pdf.swf"
},
"bDestroy":true,
"aaSorting": [[ 0, "desc" ]],
"aoColumns": [
{ "sWidth": "25%" },
{ "sWidth": "25%" },
{ "sWidth": "10%" },
{ "sWidth": "10%" },
{ "sWidth": "15%" },
{ "sWidth": "10%" },
{ "sWidth": "5%" }
]
});
}
[/code]
Now In the else case fnClearTable function is not working sometimes. I cannot figure out that sometimes its working and sometimes its not working. please Help
This discussion has been closed.
Replies
Allan