-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat(ui): display filtered rows count #112
feat(ui): display filtered rows count #112
Conversation
d46ff5e
to
ab5d918
Compare
@@ -96,6 +96,10 @@ export const DeviceTable = observer(({ data, isSuccess, isLoading, isError }: De | |||
table.setColumnFilters(existingColumnFilters) | |||
}, [debouncedGlobalFilter]) | |||
|
|||
useEffect(() => { | |||
deviceTableState.setFilteredDeviceCount(table.getRowModel().rows.length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this value can be computed, and not updated with a useEffect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is impossible. The getRowModel() function returns the final model after all processing (like filtering, sorting, and any other features) has been applied. Using useEffect ensures that you capture the correct row count once all changes are reflected in the model.
@@ -361,5 +361,6 @@ | |||
"SD Card Mounted": "SD Card Mounted", | |||
"CPU Platform": "CPU Platform", | |||
"OS": "OS", | |||
"ABI": "ABI" | |||
"ABI": "ABI", | |||
"Displayed devices count": "Count of displayed devices" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "Count of displayed devices" is too long. Maybe just "Displayed"?
No description provided.