You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like if it's possible to refresh the header and number of columns once the datatable is loaded. This is my use case: I have a dropdown that based on the option selected, results in a table with 5 columns or 7 columns, not by renaming them but by deleting and adding columns.
I cannot know beforehand all the columns to show, because that would imply querying the full dataset.
So the solution I'm looking for is to listen for the dropdown updated event with javascript, and force full datatable reload. Then the datatable service would check the request for the dropdown parameter and adjust the columns server-side. The server-side part should be easy, but I haven't found a way to force a full datatable refresh client-side (I can use destroy() but don't know how to recreate the table with the columns from the server).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I would like if it's possible to refresh the header and number of columns once the datatable is loaded. This is my use case: I have a dropdown that based on the option selected, results in a table with 5 columns or 7 columns, not by renaming them but by deleting and adding columns.
I cannot know beforehand all the columns to show, because that would imply querying the full dataset.
So the solution I'm looking for is to listen for the dropdown updated event with javascript, and force full datatable reload. Then the datatable service would check the request for the dropdown parameter and adjust the columns server-side. The server-side part should be easy, but I haven't found a way to force a full datatable refresh client-side (I can use
destroy()
but don't know how to recreate the table with the columns from the server).Is this doable?
Beta Was this translation helpful? Give feedback.
All reactions