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

WIP - fix(dataView): add option to apply row selection to all pages #689

Closed
wants to merge 124 commits into from

Conversation

arashdalir
Copy link
Contributor

@arashdalir arashdalir commented Aug 24, 2022

this is PR made ONLY to allow comparing my working solution for #545 and is not to be merged. it contains:

  1. updates to checkbox-header-row example to showcase the new functionalities
  2. updated checkbox plugin
    1. it allows users to allow selection of all items over all pages if pager is used.
    2. can now interact with dataview - stores a list of selected IDs, and in case dataset is filtered or paged, the selected ID list is managed properly and is passed to dataview
  3. changes to dataview
    1. a new event onSelectedRowIdsChanged is added to allow other parts of the system to inform dataview of changes to selected rows
    2. preserveHidden and preserveHiddenOnSelectionChange are now considered more accurately when selected rows are changed. if the latter parameter is set, the selected hidden rows (i.e. filtered rows) will still be selected if the selection changes (which is the goal of that parameter).
    3. adds functions getAllSelectedFilteredIds, getAllSelectedFilteredItems, setSelectedIds
    4. "enhances" getAllSelectedIds

this PR also contains other useful things:

  1. a bugfix for gridmenu
  2. changes to grid itself:
    1. allows the definition of ALL columns, not just the visible ones. it keeps a list of all available columns and also tracks the visible ones
    2. solves an issue with hidden columns when using multisort by considering all available columns and not just visible columns
    3. it adds some functions to facilitate the jobs mentioned above; and also allows users to get more info from grid

this PR also contains some irrelevant things:

  1. apparently, an old version of cypress/integration/example-checkbox-header-row.spec.js - irrelevant
  2. example-tree-data - no idea why I have this :/ irrelevant
  3. a treedata plugin - no idea why I have merged it into my code! :/ irrelevant

ghiscoding-SE and others added 30 commits April 8, 2020 19:33
removed the need for dedupe by using ._used flag
attempt at new recursive search
refactored funcs to allow nested array of objects or object of objects
arash dalir and others added 24 commits August 31, 2021 14:58
…y`ed events - in this case, userData is actually the triggering `jQuery.Event`
`state` will now only `scrollRowIntoView` if user wishes to
@6pac
Copy link
Owner

6pac commented Aug 24, 2022

thanks for the detailed explanation. will check it out.

ghiscoding added a commit that referenced this pull request Dec 27, 2022
- supersede #689, most Grid & DataView changes were kept with some small changes & fixes, also added more Cypress E2E tests
- when having pages and `syncGridSelection` is called with `preserveHiddenOnSelectionChange`,  clicking on Select All checkbox:
  - it will apply row selections on all rows
  - if nothing is selected and we filter data, then we click on Select All, it will apply row selections only to the item being filtered and if we remove filters then the Select All  is not expect to be selected
@ghiscoding
Copy link
Collaborator

rewrote the changes into another PR #716 since this one contains other unrelated commits and is not based on latest branch, so the new PR should fix that. There are also some small fixes applied on top of code from this PR.

@arashdalir can you please review PR #716, we won't merge it until you can confirm it

@ghiscoding ghiscoding closed this Dec 27, 2022
6pac pushed a commit that referenced this pull request Feb 3, 2023
* feat(dataView): add option to apply row selection to all pages
- supersede #689, most Grid & DataView changes were kept with some small changes & fixes, also added more Cypress E2E tests
- when having pages and `syncGridSelection` is called with `preserveHiddenOnSelectionChange`,  clicking on Select All checkbox:
  - it will apply row selections on all rows
  - if nothing is selected and we filter data, then we click on Select All, it will apply row selections only to the item being filtered and if we remove filters then the Select All  is not expect to be selected

* chore: rollback slick.grid.js changes
- the changes to slick.grid.js should be applied in a different PR and there's also one opened for this

* chore: add selected rows ids to onSelectedRowIdsChanged

* chore: add option to apply grid row selection with setSelectedIds

* chore: rename option to better represent applying row selection to grid

* chore: change setSelectedIds option defaults

* chore: show setSelectedIds options

* chore: add demo & tests for row selection on multiple pages

* chore: use setSelectedIds new option object instead of boolean arg

* chore: fix indentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants