Replies: 1 comment 1 reply
-
What do you mean with 'custom sorting'? I don't think using an
What do you mean with the 'ItemProvider function'? This is very hard to visualize without a code example This is more a discussion item, so I'll move it to the 'Ideas' section. |
Beta Was this translation helpful? Give feedback.
-
🙋 Feature Request
Allow adding custom sorting logic for FluentDataGrid sortable columns.
🤔 Expected Behavior
When using FluentDataGrid with FluentPaginator and ItemsProvider for remote API data fetching, it should be possible to implement custom sorting logic. This would allow developers to reset the paginator's page number and manage sorting without triggering an endless loop.
😯 Current Behavior
Currently, when the user changes the sorting order:
The ItemsProvider function is triggered to fetch the new data.
If pagination.SetCurrentPageIndexAsync() is called inside the ItemsProvider function to reset the paginator's page number, it triggers the ItemsProvider again.
This results in an endless loop, making it difficult to handle sorting and pagination together effectively.
💁 Possible Solution
Provide a way for developers to define custom sorting logic for sortable columns in FluentDataGrid. This could include:
Allowing users to manage sorting independently of the ItemsProvider.
Providing hooks or callbacks to handle sorting changes, giving full control to developers.
🔦 Context
I am trying to use FluentDataGrid with FluentPaginator and ItemsProvider to fetch and display remote API data efficiently. However, the current behavior makes it challenging to reset the paginator's page number when sorting changes without causing an endless loop. This feature would allow developers to handle sorting and pagination more effectively and flexibly.
💻 Examples
Beta Was this translation helpful? Give feedback.
All reactions