I am using PrimeNG for tables (p-table) with the built in session state, and NgRx SignalStore's withEntities(). I perform a HTTP request and then patch the entity state with the result.
I then use the signal to populate the table, like so: [value]="store.entities()"
The issue is that the default/initial value of withEntities()'s entities() signal is []
When PrimeNG goes to restore the state, the pagination is not restored because of this. So if I was on page 3, navigate away and come back to the table, it goes back to page 1. Column sorts and filters are maintained.
This issue does not happen if the initital value is undefined, but the default value of withEntities()'s entities() signal cannot be changed and is, by design, suppose to be [].
Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution! :sparkles:
Describe the bug
I am using PrimeNG for tables (p-table) with the built in session state, and NgRx SignalStore's
withEntities()
. I perform a HTTP request and then patch the entity state with the result.I then use the signal to populate the table, like so:
[value]="store.entities()"
The issue is that the default/initial value of
withEntities()
'sentities()
signal is[]
When PrimeNG goes to restore the state, the pagination is not restored because of this. So if I was on page 3, navigate away and come back to the table, it goes back to page 1. Column sorts and filters are maintained.
This issue does not happen if the initital value is
undefined
, but the default value ofwithEntities()
'sentities()
signal cannot be changed and is, by design, suppose to be[]
.Environment
Reproducer
No response
Angular version
18.2.2
PrimeNG version
17.18.9
Build / Runtime
TypeScript
Language
TypeScript
Node version (for AoT issues node --version)
20.16.0
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response