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
[X] bug report => Search github for a similar issue or PR before submitting
[X] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110
I observed that datatable code has missing the part save the column order state.
For example the method "onColumnHeaderDrop" doesn't call the "saveState" method, exactly like it happens with the methods "onColumnResizeEnd" or "updated".
The cause may also that state is not saved because datatable 2.9.1 calls to "beforeUnmount" instead of "beforeDestroy" method. The "beforeUnmount" is not available in Vue 2.x.
Expected behavior
The order of the columns should be saved and restored when the cache the state is used in a datatable exactly like it happens with the filters, sorting and data.
Minimal reproduction of the problem with instructions
Set a datatable with "state-key" and "state-storage" and "reorderable-columns".
Drag and drop one of the table column to another position.
Reload databable page.
Vue version: 2.6.11
PrimeVue version: 2.9.1
Browser: all
The text was updated successfully, but these errors were encountered:
It seems that state is saved correctly, the problem is when the state is restored.
I replaced:
if (this.reorderableColumns) {
this.d_columnOrder = restoredState.columnOrder;
}
by
if (this.reorderableColumns) {
this.$nextTick(() => this.d_columnOrder = restoredState.columnOrder);
}
and now it works!.
I also recomend to rename "beforeUnmount" method to "beforeDestroy" on Vue 2.x component and save the state on "beforeDestroy" instead of "update". The component peformance improve a bit with this change.
mertsincan
added
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
and removed
Status: Pending Review
Issue or pull request is being reviewed by Core Team
labels
Aug 22, 2022
I observed that datatable code has missing the part save the column order state.
For example the method "onColumnHeaderDrop" doesn't call the "saveState" method, exactly like it happens with the methods "onColumnResizeEnd" or "updated".
The cause may also that state is not saved because datatable 2.9.1 calls to "beforeUnmount" instead of "beforeDestroy" method. The "beforeUnmount" is not available in Vue 2.x.
Expected behavior
The order of the columns should be saved and restored when the cache the state is used in a datatable exactly like it happens with the filters, sorting and data.
Minimal reproduction of the problem with instructions
Vue version: 2.6.11
PrimeVue version: 2.9.1
Browser: all
The text was updated successfully, but these errors were encountered: