Qasar 1.9 table selected rows array not updating when state updates
-
The table rows and data update just fine but the selected rows array doesn’t. Anyone run into this or am i doing something wrong. I realize I have no code to show but was wondering if I could get some quicks thoughts first…
-
Don’t use selected rows data to get your data. Use just the keys and do whatever it is you want to do on those rows according to the keys.
Hope that makes sense.
Scott
-
Yeah that makes sense. Thanks.
-
fyi if it helps anyone. So going off what s.molinari was saying, this is an easy fix. I’m grabbing the items from the state in my table component’s child component and filtering by id of selected.
computed:{ ...mapGetters('foobar',['getFoobars']), updatedSelected(){ const ids = this.selected.map(a => a.id); return this.getFoobars.filter(a => ids.includes(a.id) ) } }