/* eslint react/prop-types: 0 */ import React from 'react'; import BootstrapTable from 'react-bootstrap-table-next'; import Code from 'components/common/code-block'; import { productsExpandRowsGenerator } from 'utils/common'; const products = productsExpandRowsGenerator(); const columns = [{ dataField: 'id', text: 'Product ID' }, { dataField: 'name', text: 'Product Name' }, { dataField: 'price', text: 'Product Price' }]; const expandRow = { renderer: row => (

{ `This Expand row is belong to rowKey ${row.id}` }

You can render anything here, also you can add additional data on every row object

expandRow.renderer callback will pass the origin row object to you

), showExpandColumn: true, expandHeaderColumnRenderer: ({ isAnyExpands }) => { if (isAnyExpands) { return -; } return +; }, expandColumnRenderer: ({ expanded }) => { if (expanded) { return ( - ); } return ( ... ); } }; const sourceCode = `\ import BootstrapTable from 'react-bootstrap-table-next'; const columns = [{ dataField: 'id', text: 'Product ID' }, { dataField: 'name', text: 'Product Name' }, { dataField: 'price', text: 'Product Price' }]; const expandRow = { renderer: row => (

{ \`This Expand row is belong to rowKey $\{row.id}\` }

You can render anything here, also you can add additional data on every row object

expandRow.renderer callback will pass the origin row object to you

), showExpandColumn: true, expandHeaderColumnRenderer: ({ isAnyExpands }) => { if (isAnyExpands) { return -; } return +; }, expandColumnRenderer: ({ expanded }) => { if (expanded) { return ( - ); } return ( ... ); } }; `; export default () => (
{ sourceCode }
);