AllenFang / AllenFang/react-bootstrap-table

sortFunc does not work if using multiple times the same dataField

未關閉
#425 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug enhancement
主要語言
JavaScript
星號
2.2k
分支
761
PR 合併指標
30 天內沒有已合併 PR

描述

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?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。