/* eslint max-len: 0 */
/* eslint no-alert: 0 */
import React from 'react';
import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table';


const products = [];

function addProducts(quantity) {
  const startId = products.length;
  for (let i = 0; i < quantity; i++) {
    const id = startId + i;
    products.push({
      id: id,
      name: 'Item name ' + id,
      price: 2100 + i
    });
  }
}

addProducts(5);

const options = {
  onRowClick: function(row) {
    alert(`You click row id: ${row.id}`);
  }
};

export default class SingleSelectTable extends React.Component {
  render() {
    return (
      <BootstrapTable data={ products } options={ options }>
          <TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
          <TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
          <TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
      </BootstrapTable>
    );
  }
}

@@ -512,16 +512,106 @@
 .id%7D%60);%0A
+  %7D,%0A  onRowDoubleClick: function(row) %7B%0A    alert(%60You double click row id: $%7Brow.id%7D%60);%0A
   %7D%0A%7D;%0A%0A

add onRowDbClick example