3 Answer(s)
-
0
Do you need to remember the user-adjusted table column order after refreshing?
-
0
Yes, the user settings will need to be persistant from once session to the next.
-
0
This will probably require the application to store the user's order of the table columns. And read these settings when the page is initialized and then call the datatables api to set the order of the columns.
Abp provides settings management components https://aspnetboilerplate.com/Pages/Documents/Setting-Management
However, this is not a simple feature, because you have to consider that the columns of the table may be added or removed in the future. This may cause the application to maintain the settings invalid.
My personal suggestion: You can store the column name and order store in the user's settings. The set name can be a table name, then get the settings and adjust the order in the front end.(https://datatables.net/reference/api/colReorder.move%28%29)
Set the name:
User-datatable
Settings Values:{ "name": 1, "sex": 2 }