AllenFang / AllenFang/react-bootstrap-table

onRowClick with dataFormat returns undefined row Value

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

描述

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

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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