Skip to content
Advertisement

onRowClick for react-bootstrap-table

Trying to get onRowClick to work, but nothing is happening when I click on the row.

    <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>

Advertisement

Answer

Sorry just figured it out

have to set options

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

<BootstrapTable data={products} options={options} ...
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement