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

Make perspective-viewer-hypergrid selection state save/restore compatible #903

Merged
merged 3 commits into from
Feb 5, 2020

Conversation

zemeolotu
Copy link
Contributor

@zemeolotu zemeolotu commented Feb 4, 2020

This PR makes the perspective-viewer-hypergrid selection state save/restore compatible.

If a row is selected and save is called on the perspective-viewer, the config returned will have plugin_config with the selected row index. Similarly to restore a selection state, you can call restore with the selected row index set on the plugin_config to set the selection state of the grid e.g.

viewer.restore({plugin_config: {selected: "row_index"}})

This PR also binds the perspective-select event to the fin-row-selection-changed event instead of the cellClicked callback. This allows selection events from arrow keys to be captured.

selection

@timkpaine timkpaine added enhancement Feature requests or improvements JS labels Feb 4, 2020
@timkpaine
Copy link
Member

@sc1f is this something that should also be exposed in python?

@texodus
Copy link
Member

texodus commented Feb 5, 2020

@timkpaine This can't currently be implemented as save()/restore() in python just serializes the Widget state, and plugin-config is only calculated when save() is called on the <perspective-viewer> element itself, e.g. it does not emit change events or re-calculate the View.

@texodus texodus force-pushed the hypergrid-selection-state branch from 0ed1677 to a6783b4 Compare February 5, 2020 02:00
Copy link
Member

@texodus texodus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I've rebased on master to fix merge conflicts, looks good!

@texodus texodus merged commit 86cd2c1 into master Feb 5, 2020
@texodus texodus deleted the hypergrid-selection-state branch February 5, 2020 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests or improvements JS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants