-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
Description
Describe your issue or idea
While working on #3316 I have tried enabling sorting in the table that lists the fields. I have never done this, so I researched and found some articles around the internet that add sorting functionality to tables. Some examples:
- Drupal 7 - Creating Drupal style tables with paging, sorting and sticky headers
- Drupal 7 - Creating Drupal style tables with paging, sorting and filter.
- theme_table() isn't respecting sortable fieldname
- How to disable sortable headers in Admin theme tables
- A Drupal 7 table with sortable headers and pager
Steps to reproduce (if reporting a bug)
- Taking the table in
/admin/reports/fieldsas an example, try to add'field' => 'something'to each header cell. You can test the sandbox from this dummy PR: TEST/DUMMY PR - DO NOT REVIEW OR MERGE backdrop#2325
Actual behavior (if reporting a bug)
Although adding 'field' => 'something' to the header cells causes the table headers to be rendered as sortable, the actual sorting itself does not work: the page refreshes, the ascending/descending sorting indicator and header color changes, but no sorting happens.
Expected behavior (if reporting a bug)
As a new Backdrop dev, I would expect that sorting should "magically" work in theme_table(), simply by adding 'field' => 'something' to the header cells, no matter what the source of the table cells is (db query, or simple arrays passed).
Reactions are currently unavailable