Replies: 1 comment 2 replies
-
|
Definitely, we need an We could provide some service or API prop so you can get the current state of the table and data source - however, it would expose you to (unintended) changes within the state of PS: If you're using everything controlled, then you already have all this information. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Version 0.0.10
Playing with "working with data" documentation's section and trying to implement sorting + pagination in our context, here are some thoughts about the events triggered by the data source or the table itself.
For now, to make the sorting + pagination work, the available events are:
onSortInfoChange(on DataSource)onDataParamsChange(on DataSource)onScrollToBottom(on Table)Sorting
Working with remote data while using pagination means we want to control the sorting (i.e. use the controlled mode of sorting). Also in our context, sort can be configured elsewhere. The
sortInfoandonSortInfoChangeallows us to do that, which is fine.Pagination
In order to implement the pagination, the only way is to configure the
onDataParamsChangeproperty which is in fact an event triggered for a number of reasons (sort, page, other data params events).The event itself contains the whole state of the request but does not contain the reason for which it has been triggered.
Because we already handle sort events in the
onSortInfoChange, it is hard to filter only the relevant "getPage(page)" events. From theonSortInfoChangewe cannot prevent the trigger of the accordingonDataParamsChangeevent.This problem cannot be fixed by using the
onScrollToBottomevent as it is triggered only by the viewport scrollbar events which are not taking into account page size and total row count coming from the server.Suggestions
Here are some suggestions that could be helpful from a user perspective:
onRowsRequestedwith the cursor and the page size (if configured). This would allow to work on the specific events (sort, page, ...) or only with theonDataParamsChangewhen the user wants to treat everything at a time. As a more general comment, every reasons that would trigger theonDataParamsChangeshould also have its own event.onDataParamsChange, provide a way to know which is the source event of the call. This would allow to act depending on the actual change.Beta Was this translation helpful? Give feedback.
All reactions