mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
* use the correct amount of cells when the first row is select * storybook added for development, not necessary in docs fixes react-bootstrap-table/react-bootstrap-table2#264
63 lines
1.1 KiB
JavaScript
63 lines
1.1 KiB
JavaScript
/* eslint no-unused-vars: 0 */
|
|
import React from 'react';
|
|
|
|
import BootstrapTable from 'react-bootstrap-table-next';
|
|
import Code from 'components/common/code-block';
|
|
|
|
const columns = [{
|
|
dataField: 'id',
|
|
text: 'Product ID'
|
|
}, {
|
|
dataField: 'name',
|
|
text: 'Product Name'
|
|
}, {
|
|
dataField: 'price',
|
|
text: 'Product Price'
|
|
}];
|
|
|
|
const selectRow1 = {
|
|
mode: 'checkbox',
|
|
clickToSelect: true
|
|
};
|
|
|
|
const sourceCode1 = `\
|
|
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 selectRow = {
|
|
mode: 'checkbox',
|
|
clickToSelect: true
|
|
};
|
|
|
|
<BootstrapTable
|
|
keyField='id'
|
|
data={ [] }
|
|
columns={ columns }
|
|
selectRow={ selectRow }
|
|
noDataIndication={ 'no results found' }
|
|
/>
|
|
`;
|
|
|
|
export default () => (
|
|
<div>
|
|
<BootstrapTable
|
|
keyField="id"
|
|
data={ [] }
|
|
columns={ columns }
|
|
selectRow={ selectRow1 }
|
|
noDataIndication={ 'no results found' }
|
|
/>
|
|
<Code>{ sourceCode1 }</Code>
|
|
</div>
|
|
);
|