primefaces / primevue

Next Generation Vue UI Component Library
https://primevue.org
MIT License
9.89k stars 1.19k forks source link

DataTable: @state-save emits only if state-key specified #5937

Closed wouldRewind closed 2 months ago

wouldRewind commented 3 months ago

Describe the bug

DataTable @state-save emits only if state-key provided. I think it is a bug or flaw, because in case I want to sync table state with my backend service, I have to find some workaround about this (because I don`t want to use any type of storage - neither "local" nor the "session").

For example: we have prop "v-model:filters", but there is no prop "v-model:columnsWidth" or "v-model:columnsOrders", but I need them. So, that would be very convenient if @state-save emits event, even when state-key prop is not specified.

Reproducer

https://v3.primevue.org/datatable/#stateful

PrimeVue version

3.52.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

  1. Create DataTable, fil it with some data.
  2. Add "@state-save" handler
  3. set prop "state-key" = undefined
  4. make sure @state-save is not emitted

Expected behavior

@state-save emits event, even when state-key prop equal undefined.

tugcekucukoglu commented 2 months ago

Issue tracker is used for defects only as part of our commitment to quality and continuous improvement in all areas. Enhancements are collected as valuable community feedback and managed internally so moving this enhancement ticket to our internal project management backlog.

For enhancement requests and other topics, you can open a new topic in PrimeVue discussions.