Vue-good-table: Returning from edit item and preserving table state

Created on 8 Jul 2019  Â·  2Comments  Â·  Source: xaksis/vue-good-table

Issue Type (delete the irrelevant ones)

  • [x] Enhancement Request

Specs

What version are you using?
vue-good-table": "^2.16.3

What browser?
Chrome - latest

Expected Behavior

The desired (but not expected behavior) is decribed below..

Actual Behavior

See below.. (the desired result is not currently achieved)

Steps to Reproduce the Problem

Please detail your steps here

Hi,

In my use-case, items in the table are editable, and when clicking the edit button you go to the edit page.

Once editing is complete (on “save item”), I wish to return to the table in the same state (perPage/pagination/sort/filter) as when I clicked “edit” - but with the data refreshed (to reflect the latest edit)

So in other words:
If I paginate, sort and filter out a certain “group of items” in the table that I wish to edit, - then after hitting the edit icon, saving the first item, and returning to the items table, I wish to have the same set of rows (items) displayed (in the same order and so on) - but with the latest changes applied to the item I just saved (so for instance the items Title is updated in the view)

I have been looking into the vue keep-alive functionality for this, but it doesn’t refresh the containing data (as it is uses cache internally).

From the keep-alive documentation (https://vuejs.org/v2/api/#keep-alive & https://vuejs.org/v2/api/#activated) I found the 2 functions: activated / deactivated.

I have tried re-loading the data in activated() - but this causes the table to reset (so display perPage, pagination, sorting and filtering are lost).

Is the any way you could provide a simple example of how to deep copy the relevant attributes, load the data and reapplying them, or just updating the data items without triggering a full "reset" - if at all possible?

Or do you have another preferred way of achieving this you kindly could suggest?

By the way: Excellent table - great work!

Best regards,
H

Most helpful comment

Please, please make this a priority for the next version!

All 2 comments

Please, please make this a priority for the next version!

Is there any project update made regarding this solution since that time?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sylvaincaillot picture sylvaincaillot  Â·  3Comments

sylvaincaillot picture sylvaincaillot  Â·  4Comments

jonathan-wondereur picture jonathan-wondereur  Â·  6Comments

luizzz picture luizzz  Â·  6Comments

mustfullDev picture mustfullDev  Â·  3Comments