AllenFang / AllenFang/react-bootstrap-table
onRowClick with dataFormat returns undefined row Value
- Linguagem predominante
- JavaScript
- Estrelas
- 2.2k
- Forks
- 761
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Hello,
I have a table with items and the user can click on a row to go to the item page.
In this table, I have "Text" fields and "ActionsBtn" fields (such as duplicate, sort, delete)
I want the onRowClick be working solely with text field.
I use custom dataFormat for the "ActionsBtn" fields to render it.
So I twist my onRowClick function as such to be able solely to work if the user click on a field which is a "Text field".
`const onRowClick = (row, value) => {
if (value !== undefined) {
localStorage.setItem("prestation", row.id);
history.push("/prestation#tariffs");
}
};`
It works well as all fields render via a dataFormat function render an undefined value.
For instance :
``
But now I have a problem, I am using also dataFormat for specific "Text" fields (to display a tooltip or to display correctly number Values for instance).
For instance :
``
To sumarize :
- I have found a setup where onRowClick function works for all fields of the row
- I have found a setup where onRowClick function works for all fields which are not rendered by dataFormat function
- I cannot find a setup where the onRowClick function works on all non "ActionsBtn" field since the value render by any dataFormat is always undefined.
Thanks in advance for any help or idea.
I am stucked on this issue.
Best,
Jérémy
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.