onRowMouseOver 未在反应中触发-bootstrap-table
onRowMouseOver not triggering in react-bootstrap-table
我的table是:
<BootstrapTable options={this.state.tableOptions} className="animated fadeIn" data={opportunities} striped hover condensed>
<TableHeaderColumn dataField='ticker' dataSort={true} dataFormat={this.symbolFormatter} dataAlign='center'>Symbol</TableHeaderColumn>
<TableHeaderColumn dataField='symbol' dataFormat={this.strategyFormatter} className="clearfix" dataSort={true} dataAlign='center'>Strategy</TableHeaderColumn>
<TableHeaderColumn dataField='probability' dataFormat={this.percentFormatter} dataSort={true} dataAlign='center'>Probabilty</TableHeaderColumn>
<TableHeaderColumn dataField='shamoonRank' dataFormat={this.progressFormatter} dataAlign='center' dataSort={true}>Should I Do It?</TableHeaderColumn>
<TableHeaderColumn dataField='spread' dataFormat={this.currencyFormatter} dataAlign='center' dataSort={true}>Spread</TableHeaderColumn>
<TableHeaderColumn dataField='maxLoss' dataFormat={this.currencyFormatter} dataAlign='center' dataSort={true}>Max Loss</TableHeaderColumn>
</BootstrapTable>
我的选项如下:
this.state = {
animatedClass: 'hidden',
opportunityId: null,
tableOptions: {
defaultSortOrder: 'desc',
onRowMouseOver: (row) => {
console.log('row')
}
}
}
根据 react-bootstrap-table 的文档,如果我将鼠标悬停在上面,应该会触发该函数。它不是。对我做错了什么有什么想法吗?
尝试使用下面的方法检查功能,
this.state = {
console.log('state called')
animatedClass: 'hidden',
opportunityId: null,
tableOptions: {
defaultSortOrder: 'desc',
onRowMouseOver: (row) => {
console.log('row')
}
}
}
如果日志无法正常工作,请尝试删除 TableHeaderColumn 并使用简单的 table 并尝试触发。
它对我有用
我的table是:
<BootstrapTable options={this.state.tableOptions} className="animated fadeIn" data={opportunities} striped hover condensed>
<TableHeaderColumn dataField='ticker' dataSort={true} dataFormat={this.symbolFormatter} dataAlign='center'>Symbol</TableHeaderColumn>
<TableHeaderColumn dataField='symbol' dataFormat={this.strategyFormatter} className="clearfix" dataSort={true} dataAlign='center'>Strategy</TableHeaderColumn>
<TableHeaderColumn dataField='probability' dataFormat={this.percentFormatter} dataSort={true} dataAlign='center'>Probabilty</TableHeaderColumn>
<TableHeaderColumn dataField='shamoonRank' dataFormat={this.progressFormatter} dataAlign='center' dataSort={true}>Should I Do It?</TableHeaderColumn>
<TableHeaderColumn dataField='spread' dataFormat={this.currencyFormatter} dataAlign='center' dataSort={true}>Spread</TableHeaderColumn>
<TableHeaderColumn dataField='maxLoss' dataFormat={this.currencyFormatter} dataAlign='center' dataSort={true}>Max Loss</TableHeaderColumn>
</BootstrapTable>
我的选项如下:
this.state = {
animatedClass: 'hidden',
opportunityId: null,
tableOptions: {
defaultSortOrder: 'desc',
onRowMouseOver: (row) => {
console.log('row')
}
}
}
根据 react-bootstrap-table 的文档,如果我将鼠标悬停在上面,应该会触发该函数。它不是。对我做错了什么有什么想法吗?
尝试使用下面的方法检查功能,
this.state = {
console.log('state called')
animatedClass: 'hidden',
opportunityId: null,
tableOptions: {
defaultSortOrder: 'desc',
onRowMouseOver: (row) => {
console.log('row')
}
}
}
如果日志无法正常工作,请尝试删除 TableHeaderColumn 并使用简单的 table 并尝试触发。 它对我有用