question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple column ordering

See original GitHub issue

It would be nice if there was a possibility of sorting/ordering on more than one column at a time.

From JSON:API:

An endpoint MAY support multiple sort fields by allowing comma-separated (U+002C COMMA, “,”) sort fields. Sort fields SHOULD be applied in the order specified.

GET /people?sort=age,name HTTP/1.1
Accept: application/vnd.api+json

The sort order for each sort field MUST be ascending unless it is prefixed with a minus (U+002D HYPHEN-MINUS, “-”), in which case it MUST be descending.

GET /articles?sort=-created,title HTTP/1.1
Accept: application/vnd.api+json

The above example should return the newest articles first. Any articles created on the same date will then be sorted by their title in ascending alphabetical order.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:22 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gligorancommented, Aug 14, 2015

I’d suggest using a 3-state switch for sorting instead of a modifier key so it can be done on mobile devices as well. So it would go in this order: ascending, descending, no sort.

And the order of sorting is of course as @jsenecal suggested:

ie -> click name then id would sort by “name” then by “ID” if after that you re-click name, then you would sort by ID and then by name.

But it would be a nice thing to have some sort of a visual representation of this. A small number next to the sort arrow maybe, like the one mentioned here: http://ux.stackexchange.com/a/34790/2538

1reaction
jsenecalcommented, Aug 13, 2015

I guess the CTRL + Click option is a good one, you could leave the actual explanation to the front end dev.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL - Multiple Column Ordering
For Multiple column order, add the name of the column by which you'd like to sort records first. The column that is entered...
Read more >
SQL multiple column ordering
Multiple column ordering depends on both column's corresponding values: Here is my table example where are two columns named with Alphabets and Numbers...
Read more >
How to Order By Two Columns in SQL?
After the ORDER BY keyword, add the name of the column by which you'd like to sort records first (in our example, salary)....
Read more >
DataTables example - Multi-column ordering
DataTables allows ordering by multiple columns at the same time, which can be activated in a number of different ways: ... Note that,...
Read more >
SQL Server ORDER BY clause By Practical Examples
First, you specify a column name or an expression on which to sort the result set of the query. If you specify multiple...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found