DataTable issues
DataTable issues
Hi I am new in datatable and I got some issues on that.When I am adding this line of code $ProductTable.fnSetColumnVis(index, false);
the addButton is not get fired,but when I remove it it fired.the index is declared as and assigned a value of 4( var index = 4;),because I dont want the productId to be shown in the tables.I am using the following code:
if (typeof ($ProductTable) == "undefined") {
$ProductTable = $("#tabledisplay").dataTable({
"sPaginationType": "full_numbers",
"bAutoWidth": false,
"sAjaxSource": 'Handler/ServiceHandler.ashx',
"fnDrawCallback": function () {
if ($('#tabledisplay_paginate span span.paginate_button').size()) {
$('#tabledisplay_paginate')[0].style.display = "block";
$('#tabledisplay_length')[0].style.display = "block";
} else {
$('#tabledisplay_paginate')[0].style.display = "none";
if ($("#tabledisplay tbody tr").length <= 10)
$('#tabledisplay_length')[0].style.display = "none";
else
$('#tabledisplay_length')[0].style.display = "block";
}
}
});
$ProductTable.fnSetColumnVis(index, false);
}
Help fixing this!
the addButton is not get fired,but when I remove it it fired.the index is declared as and assigned a value of 4( var index = 4;),because I dont want the productId to be shown in the tables.I am using the following code:
if (typeof ($ProductTable) == "undefined") {
$ProductTable = $("#tabledisplay").dataTable({
"sPaginationType": "full_numbers",
"bAutoWidth": false,
"sAjaxSource": 'Handler/ServiceHandler.ashx',
"fnDrawCallback": function () {
if ($('#tabledisplay_paginate span span.paginate_button').size()) {
$('#tabledisplay_paginate')[0].style.display = "block";
$('#tabledisplay_length')[0].style.display = "block";
} else {
$('#tabledisplay_paginate')[0].style.display = "none";
if ($("#tabledisplay tbody tr").length <= 10)
$('#tabledisplay_length')[0].style.display = "none";
else
$('#tabledisplay_length')[0].style.display = "block";
}
}
});
$ProductTable.fnSetColumnVis(index, false);
}
Help fixing this!
This discussion has been closed.