How to hide columns in SearchBuilder list
How to hide columns in SearchBuilder list
I am putting together a report that pulls back lots of data from a SQL server and displays it in a table for users. DataTables is providing the table display and the data is getting fed to it through the data option in the initialization.
Some columns are hidden because they are just there to provide tooltips for other columns with abbreviations in them.
When I add the SearchBuilder extension, I would expect to just see those columns that are not hidden but instead I see all the columns.
I've defined each column using
columns: [
{title:'testing', data:#column1#, visible:false, searchable:false}
]
(the #column1# is just a field coming from a ColdFusion query)
How can I format the columns so they won't be visible in SearchBuilder? I've tried configuring the columns in SearchBuilder using the columns: [1,2,3]
type of configuration but that doesn't seem to do anything. I am using the button extension and showing the SearchBuilder button through that if that makes a difference.
dom: 'Bfrtip',
buttons: [
'searchBuilder','copy','excel'
],
Here is a heavily edited/messy version of the setup. I had to take a bunch of things out so keep it private and remove all the ColdFusion code so it looks pretty ugly, but at least it shows the issue. I would like the 'testing' column to not show in the SearchBuilder.
This question has an accepted answers - jump to answer
Answers
check this demo I made: https://live.datatables.net/fabaxeni/11/edit?html,js,console,output
Thank you!!! That works perfectly.
When implementing your solution I also realized I had an older version of datatables (1.12.1). Argh. The demo I put up used the newer version though and I still couldn't get it to work, so you saved me lots of time!