react-bootstrap-table/react-bootstrap-table2

defaultSorted cannot sort more than one column

开放

#1,083 创建于 2019年9月3日

 (4 条评论) (2 个反应) (1 位负责人)JavaScript (415 个派生)batch import
help wantedsort

仓库指标

星标
 (1,249 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Describe the bug Only the first column of the defaultSorted array is considered. I see #717 was closed, but neither the documentation nor the linked example contains two columns in defaultSorted.

codesandbox https://codesandbox.io/embed/react-bootstrap-table-next-basic-example-69nq0

Note that the second sort column is on price descending, so the row with id 2 should be displayed first.

In general, the expected behavior here is that the table is first sorted by name, and then for items with the same name, they should be ordered by price in descending.

Happy to provide more examples as needed.

贡献者指南