Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

feat(Table): onFilter gets filtered rows #958

Merged
merged 13 commits into from
Dec 13, 2022
Merged

Conversation

adamhock
Copy link
Contributor

  • onFilter now has an additional parameter filteredData which users can get their filtered rows from.
  • onFilter is now called in Table.tsx instead of filterHandler.ts because there's no way to get filtered rows in the state reducer. Because of this, onFilterHandler now only returns the filters.
  • previousFilter and currentFilter are used to track when the filters are changed so onFilter is only called when this occurs. These are checked in a .useEffect after the stateReducer runs all the handling.

Closes #816

@adamhock adamhock self-assigned this Nov 30, 2022
@adamhock adamhock requested a review from a team as a code owner November 30, 2022 19:40
@adamhock adamhock requested review from a team, gretanausedaite and elephantcatdog and removed request for a team November 30, 2022 19:40
Copy link
Contributor

@gretanausedaite gretanausedaite left a comment

Choose a reason for hiding this comment

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

Have you tested with subrows?

Copy link
Contributor

@elephantcatdog elephantcatdog left a comment

Choose a reason for hiding this comment

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

No other comments

@adamhock
Copy link
Contributor Author

adamhock commented Dec 8, 2022

Have you tested with subrows?

subrows have been tested!

Copy link
Contributor

@gretanausedaite gretanausedaite left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@adamhock adamhock merged commit 84bc9e9 into main Dec 13, 2022
@adamhock adamhock deleted the adam/get-filtered-rows branch December 13, 2022 16:08
mayank99 pushed a commit to iTwin/iTwinUI that referenced this pull request Dec 21, 2022
* `onFilter` now has an additional parameter `filteredData` which users can get their filtered rows from.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Table: need a way to get filtered rows
4 participants