Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise column state attributes #1896

Closed
bmblb opened this issue Nov 18, 2020 · 1 comment
Closed

Revise column state attributes #1896

bmblb opened this issue Nov 18, 2020 · 1 comment
Assignees
Labels
bug Something isn't working resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@bmblb
Copy link

bmblb commented Nov 18, 2020

Consider following usecase.

  1. There's an app like this which saves its state:
import 'MyFilterField.js';

grid = new Grid({
  columns: [
    { type : 'mycolumn', filterable : { filterField : { type : 'myfilterfield' } } }
  ]
});

// load state if exists
const state = JSON.parse(localStorage.getItem('foo'));
if (state) { grid.state = state; }

// save state to localStorage
localStorage.setItem('foo', JSON.stringify(grid.state));
  1. Now inspect local storage and see column has filterable with field type.
  2. Let's say app changed and we no longer import MyFilterField:
grid = new Grid({
  columns : [
    { type : 'mycolumn' }
  ]
})
  1. now when we load the app we get an exception, because column is trying to instantiate a widget which doesn't exist

To do:

  1. filterable should not be part of state, it cannot be modified in UI
  2. filters are saved in the store state, column has nothing to do with them
@bmblb bmblb added the bug Something isn't working label Nov 18, 2020
@isglass isglass added this to the 4.0.x milestone Nov 18, 2020
@isglass
Copy link
Contributor

isglass commented Nov 18, 2020

Agree, does not make sense to store filterable in state. Please also remove text while at it

Handled in Column.getState()

@bmblb bmblb changed the title Column should not put filterable to a state Revise column state attributes Nov 18, 2020
@bmblb bmblb added in progress ready for review Issue is fixed, the pull request is being reviewed resolved Fixed but not yet released (available in the nightly builds) and removed in progress ready for review Issue is fixed, the pull request is being reviewed labels Nov 30, 2020
@bmblb bmblb modified the milestones: 4.0.x, 4.0.4 Dec 1, 2020
@bmblb bmblb self-assigned this Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

2 participants