mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-03-24 14:44:27 +00:00
add a large table example
This commit is contained in:
32
packages/react-bootstrap-table2-example/examples/basic/large-table.js
vendored
Normal file
32
packages/react-bootstrap-table2-example/examples/basic/large-table.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
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(5000);
|
||||
|
||||
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 }
|
||||
selectRow={ { mode: 'checkbox' } }
|
||||
cellEdit={ cellEditFactory({
|
||||
mode: 'click'
|
||||
}) }
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
Reference in New Issue
Block a user