AllenFang / AllenFang/react-bootstrap-table

return popover element on dataFormat

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

描述

I am trying to return popover using an overlay within `dataFormat` option and it does not seem to work.

```
serviceFormatter(cell, row) {
let exemptionType = 'CM';
if( (row.comms_matrix_id == null || row.comms_matrix_id == '0' ) && (row.service_id == null || row.service_id == 'All' || row.service_id == '0')){
exemptionType = 'Global';
}else if( (row.comms_matrix_id == null || row.comms_matrix_id == '0') && (row.service_id != null || row.service_id != 'All' || row.service_id != '0' )){
exemptionType = 'Service';
}

let exemptionTypeText = row.service + `${exemptionType}`;

if(cell && cell.length> 0){
exemptionTypeText = row.service + `${exemptionType}`;
}
let popover = {exemptionType} exemption
return (

{exemptionTypeText}

);
}
```

the error i get is

`Uncaught Error: React.Children.only expected to receive a single React element child.`

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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