/* eslint no-unused-vars: 0 */ /* eslint no-alert: 0 */ import React from 'react'; import { BootstrapTableful } from 'react-bootstrap-table2'; import Code from 'common/codeBlock'; const products = []; function addProducts(quantity) { const startId = products.length; for (let i = 0; i < quantity; i += 1) { const id = startId + i; products.push({ id, name: `Item name ${id}`, price: 2100 + i }); } } addProducts(5); const columns = [{ dataField: 'id', text: 'Product ID', headerEvents: { onClick: () => alert('Click on Product ID header column') } }, { dataField: 'name', text: 'Product Name' }, { dataField: 'price', text: 'Product Price' }]; const sourceCode = `\ const columns = [{ dataField: 'id', text: 'Product ID', events: { onClick: () => alert('Click on Product ID header column') } }, { dataField: 'name', text: 'Product Name' }, { dataField: 'price', text: 'Product Price' }]; `; export default () => (

Try to Click on Product ID header column

{ sourceCode }
);