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.

Table sorter only works in one direction.

See original GitHub issue

Environment(required)

  • antd version: 2.8.1
  • OS and its version: na
  • Browser and its version: Chrome

What did you do? Please provide steps to re-produce your problem.

Use a sorter on a table column

What do you expected?

Clicking on one direction arrow produces the reverse sorting order of clicking the other.

What happen?

Sorting works in descending order, but not in ascending.

Re-producible online demo

Visible on https://ant.design/components/table/#components-table-demo-head: Click “Up” on Name column produces: Jim - Jim - Joe - John. Click “Down” incorrectly produces: John - Jim - Joe - Jim.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jakelauercommented, Apr 2, 2018

This issue does still happen. Please see this demo: https://codepen.io/anon/pen/rdKzZr?&editors=001

I have changed the ages so they are all different. Descending works correctly and produces [41, 36, 32, 31, 22, 6], but ascending produces [32, 41, 22, 36, 6, 31]. It looks to me like the data is being sorted in pairs (32, 41) / (22, 36) / (6, 31). Each of those pairs is sorted ascending, but the list of pairs is out of order.

1reaction
JesperWecommented, Mar 16, 2017

I found more things missing in docs. Will write PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery tablesorter ajax table only sorting one direction
I have a table that I load via a jQuery load command. in the callback of the load function I initiate the tablesorter...
Read more >
Tablesorter Plugin: Sort Alpha is only working in one direction
Hi, I have a sort parser working on a table: Table - parser for the 'Companies' column If anyone could tell me why...
Read more >
jQuery plugin: Tablesorter 2.0
Property Type Default Link cancelSelection Boolean true cssAsc String "" cssChildRow String "tablesorter‑childRow" 1 2
Read more >
Sort header
To add sorting behavior and styling to a set of table headers, add the <mat-sort-header> component to each header and provide an id...
Read more >
jQuery tablesorter 2.0 - Sorting & Filtering with Colspans
Sort Column 0 1 (toggle sort direction) - There is no method to use the UI to sort the second column because it...
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