AllenFang / AllenFang/react-bootstrap-table

sortFunc does not work if using multiple times the same dataField

Đang mở
#425 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug enhancement
Ngôn ngữ chính
JavaScript
Star
2.2k
Fork
761
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi,
I'm creating an issue first before working on some code to fix this to get your opinion.
The issue is the following:
I use the same dataField in multiple columns (I do so because the property targeted by dataField is an object and I display one part or another of the object depending on the column).
I also want to be able to sort those columns based on the displayed information.
So that requires to use a custom sortFunc.
However, since TableDataStore keys the colInfos structure based on the dataField value, in the end, there is only one set of sorting options available.
I cannot use the sortFuncExtraData object to workaround this since it's subject to the same issue.

The only option I see to fix this is keep the array structure provided in the input to Bootstrap table and update the sort / filter part of the code to use the index of the column rather than the dataField + update calls to this code.

What do you think?
Is that an approach you would accept in a pull request?

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.