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

EuiInMemoryTable - request ability to set pageIndex and pageSize externally #3982

Closed
alvarezmelissa87 opened this issue Aug 31, 2020 · 2 comments · Fixed by #4038
Closed

Comments

@alvarezmelissa87
Copy link

alvarezmelissa87 commented Aug 31, 2020

We've run into an issue in ML where the EuiInMemory table always gets reset to page index 0 regardless of what props are passed in. As a workaround, we've had to use the EuiBasicTable with the EuiSearchBar and have done our own handling of the search, sorting, and pagination functionality. This results in a lot of extra code the aim of which is to be able to pass in what page index the table should be on when it renders. We've had to add this in 3 places in ML as well as Transforms.

E.g. in the anomaly detection jobs list https://github.com/elastic/kibana/blob/master/x-pack/plugins/ml/public/application/jobs/jobs_list/components/jobs_list/jobs_list.js#L77

It's challenging to maintain a stable items reference as, in ML and Transforms, we do want to keep the jobs/transforms list as up-to-date as possible and we re-fetch the table items frequently resulting in pagination being reset when the contents change at all.

It feels like an indicator that maybe it would be more efficient to have this functionality built into the EuiInMemoryTable

Docs example use case:

The In-memory table with search and external state example in the docs has an Online/Offline column. In the case where you're re-fetching the table items and nothing changes but the Online/Offline property - you'd want to be able to update that property and maintain the current page index/size since the items themselves aren't changing.

@joshdover
Copy link
Contributor

@chandlerprall Any idea on when this may be fixed? It's creating a few bugs within Kibana.

@chandlerprall
Copy link
Contributor

@joshdover marking this as urgent, we'll address this week

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 a pull request may close this issue.

3 participants