Set Column defaultly to hidden using buttons.
Set Column defaultly to hidden using buttons.
erpankajs
Posts: 4Questions: 0Answers: 0
I am using datatables, Sometime its create too much confusion when documentation does not gave the answer for my question. But still i am fan of datatables.
I am using buttons extensions: for PDF, CSV, PRINT, EXCEL and SHOW COLUMNS
When print and pdf is clicked the result is good, but one page title is added on the top. I am not founding any way to edit this as per the table.
When show columns is used, i want to hide some columns by default on table load (page load)
// Here's the code, which shown the columns visibility options
buttons: [{
extend: 'collection',
text: 'Show Columns',
buttons: [ 'columnsVisibility' ],
visibility: true
}]
This discussion has been closed.
Replies
Are you using the Buttons extension? This provides functionality to hide/show columns.
If you desire a show/hide all columns, check out my answer in the following thread on how I solved this for my applicaiton https://datatables.net/forums/discussion/comment/89772/#Comment_89772