Skip to content

On the dbadmin interface of the dashboard app, row ordering works only at second click #1021

@nicozanf

Description

@nicozanf

See https://groups.google.com/g/py4web/c/e5MgA_jNUzA/m/Q995MKndAQAJ?utm_medium=email&utm_source=footer

by Hadi Zarkoob - hadi.zarkoob114@gmail.com

When a user first opens a table, the rows are sorted in ascending order by the row index. If they click the index header, the string ?orderby={table_name}.id is added to the URL, but the order does not actually change. When they click the index header a second time, the string ?orderby=~{table_name}.id is added to the URL and the order is reversed. From that point on, clicking the header continues to toggle both the URL and the row order, which is the expected behavior. The problem only occurs the very first time a table is opened.

I would normally categorize this as a minor issue, but it’s worth noting that clicking the index header is a very common action, since users often open a table specifically to see the latest entries.

One possible quick and easy solution would be to update the code that handles header clicks as follows: treat a URL without any orderby parameter exactly the same way as a URL with ?orderby={table_name}.id. In practice, this could simply mean replacing a URL without an orderby parameter with the same URL with ?orderby={table_name}.id appended before any downstream analysis is performed.

Metadata

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