Reputation: 53
i have a question, what i want to achieve is something like this:
I'm using Laravel in my project, but i want to let every user customize his own tables views (show or hide columns)
For example, in the next image i have three columns:
[First Header]
But i want to let the user pick (show or hide) the columns he wants,
[Extra Columns]
How do i achieve something like that? I am using Laravel and Jquery Datatables for the tables views.
I was thinking of create a table in the database which can store the columns (in a json) for every user and each module. I'd like to know if there is a better approach.
Thanks in advance, blessings!
Upvotes: 2
Views: 1293
Reputation: 53
As @Remul said in his comment, Datatable has its own functions (stateSaveCallback and stateLoadCallback) Mixing that with State saving gave me what i needed
https://datatables.net/reference/option/stateSaveCallback https://datatables.net/reference/option/stateLoadCallback
Upvotes: 1