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

[BUG]: DetailsList - Automatic sorting functionality does not work when working with delegable functions in "Items" #297

Closed
winthermichael opened this issue Mar 6, 2023 · 3 comments
Assignees
Labels
Component: DetailsList 👋 needs author feedback Waiting on a response from the author

Comments

@winthermichael
Copy link

Description of the bug
When I reference a Dataverse-table (using a simple, delegable SortByColumns(Filter())-function), the data that is returned is not sorted according to the parameters set in the SortByColumns-function, nor the sort order defined in a referenced Dataverse-view.

The sorting-functionality works fine when I manually click on the column header of the DetailsList - but the point of the SortByColumns-functions is to make sure that the data is pre-sorted when the user navigates to the screen.

When manual sorting-functionality (which is imposed when I am working with a local collection or a non-delegable function) also works fine.

To reproduce
Steps to reproduce the behavior:

  1. Add a delegable function to "Items" that references a Dataverse-table (DO NOT reference a local collection / table), and use SortByColumns to sort the records by name. Make sure to have a suitable number of records (+10) in the table.

Example: SortByColumns( Filter( 'Checklist steps', Checklist.'Checklist ID' = GLOBVARChecklistRecord.'Checklist ID' ), "cgi_stepnumber", SortOrder.Ascending )

  1. Add the column that is being sorted to the column_Items property, so that it is being displayed.

  2. Confirm the unintended behaviour.

@winthermichael winthermichael added bug Something isn't working ⚠️ needs triage Has not been triaged by the team yet. labels Mar 6, 2023
@denise-msft
Copy link
Member

@winthermichael Please refer to the automatic sorting section in the DetailsList documentation for help with sorting a Dataverse table. Please let us know if that doesn't meet your needs.

@denise-msft denise-msft added 👋 needs author feedback Waiting on a response from the author Component: DetailsList and removed ⚠️ needs triage Has not been triaged by the team yet. bug Something isn't working labels Jul 12, 2023
@VFedyaev
Copy link

@denise-msft Please provide solution how to set default sorting by Descending in DetailsList based on Dataverse data. Because autosorting by default sort by Ascending!

@RajeevPentyala RajeevPentyala added this to the Backlog milestone Nov 17, 2023
@denise-msft
Copy link
Member

@winthermichael if using automatic sorting, please follow the documentation and configure the sorting behavior on the DetailsList and within the columns instead of using SortByColumns() formula as the items property.

Also, please check out the modern table control to see if the new sorting capability meets your needs better, it will be much easier to use.

@VFedyaev please use the CurrentSortDirection to determine sort direction. I also encourage you to try out the modern table to see if that meets your needs better.

Please reopen if this does not solve your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: DetailsList 👋 needs author feedback Waiting on a response from the author
Projects
None yet
Development

No branches or pull requests

4 participants