Skip to content

Sort direction changing on forceRender #1485

Open
@Zambelli24

Description

Describe the bug
For a server side data table, calling forceRender causes the applied sort direction to always be set to ascending for the selected column. When the sort is already ascending this is fine for the user. When the sort is descending, its unexpectedly flipped. This affects only version 6.2.0. I tested against 6.1.0 as well and the issue is not present.

To Reproduce
Steps to reproduce the behavior:

  1. Create a table with server-side data, pagination, sort, and search configured
  2. Add a way to update the grid using forceRender. In my use case, there is an external filter that adds a new parameter the API calls being made. This could be as simple as a button that just calls forceRender
  3. Run the table and set the sort on any column to be descending
  4. Execute the method to call forceRender
  5. Notice that the sort direction stays on the correct column but flips from ascending to descending

Expected behavior
The sort direction should stay the same whenever forceRender is called regardless of what it was.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: macOS Sonoma 14.4
  • Browser: Chrome
  • Version: 130.0.6723.92 (Official Build) (arm64)

Additional context
This only seems to happen for server-side grids. Client side data sorts are not affected. I followed the sort config defined on the GridJs docs and found that the value for columns inherently has the wrong direction coming back on it when this bug occurs.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions