AllenFang / AllenFang/react-bootstrap-table

sortFunc does not work if using multiple times the same dataField

Aberta
#425 5 comentários 0 reações 0 responsáveis Ver no GitHub
bug enhancement
Linguagem predominante
JavaScript
Estrelas
2.2k
Forks
761
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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?

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.