Hiding a Column in a Datatable
Hiding a Column in a Datatable
bhargava26
Posts: 2Questions: 2Answers: 0
if (typeof dataTable_leads == 'undefined') {
dataTable_leads = $('#GlTable').dataTable({
"bDestroy": true,
"bRetrieve": true,
"bProcessing": true,
"bDeferRender": true,
"aaData": dataset,
"bPaginate": false,
"aaSorting": [
[5, 'asc']
], //desc
"columnDefs": [
{ "visible": false, "targets": [0] }
],
"aoColumns": [{
"sTitle": "Row ID",
"mData": "rowId",
},
{
"sTitle": "Product Type",
"mData": "productCode",
},
{
"sTitle": "Product Name",
"mData": "productName",
},
{
"sTitle": "Transaction Type",
"mData": "transactionType",
},
{
"sTitle": "Description",
"mData": "transactionDescription",
},
{
"sTitle": "Transaction Mode",
"mData": "transactionMode",
},
{
"sTitle": "GL Debit",
"mData": "glDr",
},
{
"sTitle": "GL Credit",
"mData": "glCr",
},
{
"sTitle": "Action",
"mRender": function(data, type, row) {
// return " <button type='button' class='btn btn-primary'>Update</button> <button type='button' class='btn btn-danger'>Delete</button>";
return "<span class='jfs-edit updateGL'></span><span class='jfs-delete deleteGL'></span>";
}
}
]
});
My datatable is working properly. But am trying to hide first column in my table. But its not working. Please help me
This discussion has been closed.