admin管理员组文章数量:1399172
I am using a react bootstrap table to display some data stored in the info
array.
<BootstrapTable data={info} striped={true} hover={true} search={true} condensed={true} selectRow={selectRowProp(onRowSelect, info, selected)}>
<TableHeaderColumn isKey={true} dataField="name"> Name </TableHeaderColumn>
<TableHeaderColumn dataField="class"> Class </TableHeaderColumn>
<TableHeaderColumn dataFormat={myStyle} dataField="price"> Price </TableHeaderColumn>
</BootstrapTable>
Some of the rows may have an extra property oldPrice
, which I would like to show as a tooltip over the shown price. How can I do that?
I am using a react bootstrap table to display some data stored in the info
array.
<BootstrapTable data={info} striped={true} hover={true} search={true} condensed={true} selectRow={selectRowProp(onRowSelect, info, selected)}>
<TableHeaderColumn isKey={true} dataField="name"> Name </TableHeaderColumn>
<TableHeaderColumn dataField="class"> Class </TableHeaderColumn>
<TableHeaderColumn dataFormat={myStyle} dataField="price"> Price </TableHeaderColumn>
</BootstrapTable>
Some of the rows may have an extra property oldPrice
, which I would like to show as a tooltip over the shown price. How can I do that?
3 Answers
Reset to default 3Related, if you want to display the cell's value on hovering, you need to write a little function:
const columnHover = (cell, row, enumObject, rowIndex) => {
return cell
}
<TableHeaderColumn
width='260px'
dataField='cellContents'
editable={false}
dataSort
columnTitle={columnHover}
>
Some text
</TableHeaderColumn>
You can use columnTitle property as columnTitle="Put your old price here"
<TableHeaderColumn dataFormat={myStyle} dataField="price" columnTitle="Put your old price here"> Price </TableHeaderColumn>
Set your tooltip ponent up outside the BootstrapTable. Use the columnClassName attribute on TableHeaderColumn to give your price cells a class that you can attach your tooltip to using tether.
本文标签: javascriptReact bootstrap table with tooltipStack Overflow
版权声明:本文标题:javascript - React bootstrap table with tooltip - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744206986a2595236.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论