Datatable stateStorage #300
-
I am attempting to save the data table state to local storage so my users can setup their filters/etc and have it persist between visits to the site. On the DataTable component, I set stateStorage="local" and stateKey="my_form" .. looking at the local storage, I do see the my_form being created and updated as the state of DataTable is adjusted. GREAT! However -- As soon as I reload the page, my local storage gets reset to {multiSortMeta:[]} Below is a simple example showing the issue. import { DataTable } from "primereact/datatable";
import { Column } from "primereact/column";
export default function SimpleForm() {
return (
<DataTable stateStorage="local" stateKey="my_form">
<Column key="col1" field="col1" header="Col1" filter></Column>
<Column key="col2" field="col2" header="Col2" filter></Column>
</DataTable>
)
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Most likely a bug. I would open a ticket with your StackBlitz reproducer. |
Beta Was this translation helpful? Give feedback.
Most likely a bug. I would open a ticket with your StackBlitz reproducer.