Skip to content

Add sort indicator arrows and pointer cursor to DataTable headers#424

Open
ronikriger wants to merge 1 commit into
beautyjoy:mainfrom
cs169:feature/datatable-sort-indicators
Open

Add sort indicator arrows and pointer cursor to DataTable headers#424
ronikriger wants to merge 1 commit into
beautyjoy:mainfrom
cs169:feature/datatable-sort-indicators

Conversation

@ronikriger

Copy link
Copy Markdown
Contributor

Custom CSS-only approach using ::after pseudo-elements with Unicode triangles. White on dark headers, half-opacity unsorted indicator, full-opacity for active sort direction. No arrow on non-orderable columns (sorting_disabled). Applies globally to all DataTables.

What this PR does:

  • Added _datatable_sorting.scss with custom ::after pseudo-element arrows (▲/▼) for .sorting, .sorting_asc, and .sorting_desc header classes.
  • Sortable headers now show cursor: pointer; non-sortable headers (.sorting_disabled) show no arrow and cursor: default.
  • Arrows render white on .thead-dark backgrounds for visibility.
  • Imported the partial into application.scss.

Who authored this PR?

@ronikriger

How should this PR be tested?

  • Visit any page with a DataTable (e.g. /teachers, /schools)
  • Verify sortable column headers show ▲▼ arrows and the cursor changes to a pointer on hover
  • Click a header to sort — verify the arrow updates to show the active sort direction
  • Confirm non-sortable columns (e.g. Actions) show no arrow and no pointer cursor
  • Run bundle exec cucumber features/datatable_sort_indicators.feature

@cycomachead @armandofox @mdawn65

Custom CSS-only approach using ::after pseudo-elements with Unicode
triangles. White on dark headers, half-opacity unsorted indicator,
full-opacity for active sort direction. No arrow on non-orderable
columns (sorting_disabled). Applies globally to all DataTables.
@kienthuynh kienthuynh deleted the feature/datatable-sort-indicators branch May 6, 2026 19:06
@kienthuynh kienthuynh restored the feature/datatable-sort-indicators branch May 6, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant