colReorder, colVis and reloading settings
colReorder, colVis and reloading settings
Hi,
We are using colReorder and colVis together and keep having an issue when reloading the settings from localstorage. If a column is moved and another column is hidden, when the page is refreshed and the data is pulled back in from localstorage, the incorrect column is hidden.
It seems the issue occurs here on this line of the _fnLoadState function (where it is not taking into account the reordered columns)
columns[i].bVisible = col.visible;
replacing this line with:
columns[state.ColReorder[i]].bVisible = col.visible;
fixes the issue,
I must be missing something here, as i'm sure many people have used this before in this way and i'd rather not change the source of DataTables.
Any ideas?
Thanks
Answers
Hi Deadlock,
Are you assigning your columns using the
data
property? I had a similar situation where I was binding my columns using thename
property then switch over todata
fixed mylocalStorage
woes.Before:
After:
Never the less bugs are always possible, but I lack the knowledge to properly assess that.