mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
32 lines
609 B
JavaScript
32 lines
609 B
JavaScript
import React from 'react';
|
|
|
|
import BootstrapTable from 'react-bootstrap-table-next';
|
|
import cellEditFactory from 'react-bootstrap-table2-editor';
|
|
import { productsGenerator } from 'utils/common';
|
|
|
|
const products = productsGenerator(5);
|
|
|
|
const columns = [{
|
|
dataField: 'id',
|
|
text: 'Product ID'
|
|
}, {
|
|
dataField: 'name',
|
|
text: 'Product Name'
|
|
}, {
|
|
dataField: 'price',
|
|
text: 'Product Price'
|
|
}];
|
|
|
|
export default () => (
|
|
<div>
|
|
<BootstrapTable
|
|
keyField="id"
|
|
data={ products }
|
|
columns={ columns }
|
|
cellEdit={ cellEditFactory({
|
|
mode: 'click'
|
|
}) }
|
|
/>
|
|
</div>
|
|
);
|