试图使onRowClick正常工作,但是当我单击该行时没有任何 react 。

    <BootstrapTable data={products} onRowClick={this.onClickHandler.bind(this)} striped={true} hover={true} pagination={true} search={true} searchPlaceholder="Search">
        <TableHeaderColumn isKey={true} dataField="_id">Customer ID</TableHeaderColumn>
        <TableHeaderColumn dataField="customername" >Customer Name</TableHeaderColumn>
        <TableHeaderColumn dataField="address">Address</TableHeaderColumn>
        <TableHeaderColumn dataField="city">City</TableHeaderColumn>
        <TableHeaderColumn dataField="createdate">Last Order Date</TableHeaderColumn>
        <TableHeaderColumn dataField="style">Style</TableHeaderColumn>
        <TableHeaderColumn dataField="dimensions">Dimensions</TableHeaderColumn>
    </BootstrapTable>

最佳答案

对不起,只是想通了

必须设置选项

var options = {
 onRowClick: function(row){
 }
}

<BootstrapTable data={products} options={options} ...

关于javascript - onRowClick用于react-bootstrap-table,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36881022/

10-11 07:34