Skip to content

Added columns not getting restored. #3476

@settysreekanth

Description

@settysreekanth

Newly added columns are not getting restored. Follow the below steps to reproduce the issue,

  1. Add new column (Click Add)
  2. save grid state in localstorage
  3. Change state of grid but don't save state
  4. Now restore grid state by clicking Restore button and this fetches settings from localstorage (working)
  5. However refresh the browser.
  6. Restore grid state from localstorage (Not working)

I have created plunker for this issue http://plnkr.co/edit/mR7lbG?p=preview

Activity

PaulL1

PaulL1 commented on May 16, 2015

@PaulL1
Contributor

I think the problem is that you're making an assumption that restore state will add columns that aren't there. Restore will only add settings to columns it can find - the base column needs to be there.

If you change the plunker such that the columns are there but hidden, then it works. http://plnkr.co/edit/c0Xwl8QWgS6RWr7aQUsX?p=preview

settysreekanth

settysreekanth commented on May 18, 2015

@settysreekanth
Author

@PaulL1 Thanks for your reply. I modified my plunker but I have to click restore button twice to restore my actual settings.

http://plnkr.co/edit/g6hGjz?p=preview
Steps:

  1. Click Add button twice to add 2 columns like Company and Company2
  2. Sort Company column in Asc or Desc order and Click save state button.
    3.Refresh the page and click restore state button twice to restore the actual state (i.e. to restore state including sorting on company column).

Here clicking restore state first time will restore columns and 2nd time will restore actual settings.

Could you please help me to find out the issue here?

settysreekanth

settysreekanth commented on May 21, 2015

@settysreekanth
Author

@PaulL1 could you please suggest if it is a bug on UI grid?

c0bra

c0bra commented on Jun 19, 2015

@c0bra
Contributor

@PaulL1 seems to me that restore state should restore everything at once if it's able to, would you agree?

added this to the Future milestone on Jun 19, 2015
PaulL1

PaulL1 commented on Jun 19, 2015

@PaulL1
Contributor

Yes, it should, but I suspect it's more a timing/usage issue. I'll take a look later today.

self-assigned this
on Jun 19, 2015
HarnikNoa

HarnikNoa commented on May 17, 2016

@HarnikNoa

Was this issue ever resolved? I'm running into a similar issue, where it takes me two button clicks ("reset grid") to restore to the correct grid setting. The first restores (or clears, in this case) the filters, the second moves the columns back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @c0bra@PaulL1@mportuga@settysreekanth@HarnikNoa

      Issue actions

        Added columns not getting restored. · Issue #3476 · angular-ui/ui-grid