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.

Select all (rows) checkbox in table resets sorting

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.10.0

Environment

MacOS 10.13.6, Chrome 69.0.3497.100 (64-bit)

Reproduction link

https://codepen.io/hon2a/pen/NOpQwx?&editors=001

Steps to reproduce

  • Create a Table with both column sorting and row selection.
  • Sort the table by some sortable column.
  • Click on the “Select all” checkbox in the top left corner of the table to select all rows at once.

What is expected?

All rows are selected and the current sorting is retained.

What is actually happening?

Rows are selected, but the sorting is lost (reset). Additionally, when the “Select all” checkbox is hovered over, a “Sort” tooltip is shown, which shouldn’t be there.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
zombieJcommented, Oct 15, 2018

Hi @hon2a , The root cause of this issue is that code not check column is sortable when click the header. So I ref it to the commit.

Tooltip update is here: https://github.com/ant-design/ant-design/commit/f1d1d87de08eadaa00f3d4c3c302f16e77ea8020

1reaction
notdronecommented, Oct 10, 2018

checking if columnKey isn’t a selection-column before changing state might be a temporary fix

handleChange = (pagination, filters, sorter) => {
    console.log('Various parameters', pagination, filters, sorter);
    if(sorter.columnKey!=='selection-column'){
      this.setState({
        sortedInfo: sorter,
        filteredInfo: filters,
      });
    }
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

TH element with (Select All) Checkbox and TableSorter
The issue is that since I have the tablesorter js on the table it will select or deselect all of the rows but...
Read more >
Best practice for sorting and being able to "check all" in a table ...
You can use the Check All / Select All button just above or below the table which will enable the user to select...
Read more >
Sorting by selected rows when using checkboxes for selection ...
Hi all, I have a table where the user can select rows with a checkbox column. Then, I also want to be able...
Read more >
Table - Ant Design
Rows can be selectable by making first column as a selectable column. You can use rowSelection.type to set selection type. Default is checkbox...
Read more >
Add a Total row to a table - Microsoft Support
Training: In Microsoft Excel, select the Design tab and then select the Total Row checkbox to add a Total Row. You can also...
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