Is it possible to be able to hide a datatables column by default?
e.g
$this->crud->addColumn([
'name' => 'phone',
'hidden' => true,
]);
So then the column is still loaded in, but it is hidden - then you can use the column visibility to show it if needed?
Not that I know of, no...
Would be nice, but I bet it'll be difficult like hell, because of datatables-responsive and datatable-colvis incompatibility...
Well I believe you know my stance on the data tables responsive front :D
I'm sure we can come up with a solution for those who do not want to poison their eyes with collapsed tables :D
My suggestion as talking on gitter :P with the new release of disabling responsive tables we can add in colvis if responsive tables are disabled. 2 for 1 special?
@OwenMelbz I know, I know :-)
But I personally think the collapsible columns + "..." buttons combo is great. So far the end-users I've questioned are impressed. Well not impressed, but, you know... they thought "_oh but isn't that how it's supposed to work?_". I think that's as close to a compliment as it gets :-)
@OwenMelbz I tried this once, but never got it to work: https://datatables.net/extensions/buttons/examples/column_visibility/columns.html
Just finished the PR for this here https://github.com/Laravel-Backpack/CRUD/pull/1703 - I think it adds a lot of flexibility, having different:
visibleInTable visibleInExportvisibleInModalI can confirm you can just toggle visibleInTable to false for a column, and then it won't show up in the table, BUT it will still be searchable. So - 2 birds with one stone :-)
Great! thanks!