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.

q-table - please add "sort direction" param to column definition

See original GitHub issue

Here’s a video describing the problem: https://www.screencast.com/t/GtHFyqLMA

It would be wonderful if I could add an attribute as below that would set the default sort direction at the column level, rather than just once for the initial load in the pagination object:

{
  name: "globalblacklist",
  align: "center",
  label: "GBL",
  field: "globalblacklist",
  sortable: true,
  **sortDir: 'desc' || descending: true  //defines initial sort when column header is clicked**
},

Numeric columns are nearly always more useful sorted desc initially, whereas alpha columns are better sorted asc. This is the case whether the data comes from an array of objects or from an ajax call.

And since I’m stuck on Q1 at the moment, backporting it there would be great. Although having it in Q2 might be enough for me to make the switch…

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
rstoenescucommented, Apr 25, 2021

Will be available in Quasar v2.0.0-beta.13 & Quasar v1.15.11: new prop (column-sort-order) and new “columns” definition prop (sortOrder).

Values: “ad” (ascending-descending) and “da” (descending-ascending). Default is “ad”.

PS: thank you for being a sponsor.

1reaction
Daemachcommented, Mar 25, 2022

Using your updated code worked. Thanks again for following up!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Qt, How can I sort QTableWidget column if the cells are widgets
I have a QTableWidget , some columns are filled with text, some with numbers, these columns are fine to sort. But I also...
Read more >
Table | Quasar Framework
Dessert (100g serving) Calories Fat (g) Carbs (g) Protein (g) Sodium (mg) Ca... Index: 4994 Cupcake 305 3.7 67 4.3 413 3% Index: 4995 Gingerbread...
Read more >
Data Table Sort Direction Param Not Firing On Certain Columns
If I comment that out then the sort direction param works fine -but the columns values are no longer correctly sorted.
Read more >
Data Table - Quasar Framework
Initial sorted column, sorting direction & page is configured through the pagination prop. Check the Pagination section below.
Read more >
Constructing a Table — Astropy v5.2
from astropy.table import QTable, Table, Column >>> from astropy import units as u ... of data columns with the same length defined in...
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