react-bootstrap-table2/packages/react-bootstrap-table2-example/examples/basic/no-data-table.js
Allen ae5c677854 Implement stateful layer (#48)
* implement an internal stateful layer for data change(update/insert/delete)

* BootstrapTable -> BootstrapTableful
2017-09-03 02:25:56 -05:00

35 lines
797 B
JavaScript

import React from 'react';
import { BootstrapTableful } from 'react-bootstrap-table2';
import Code from 'common/codeBlock';
const columns = [{
dataField: 'id',
text: 'Product ID'
}, {
dataField: 'name',
text: 'Product Name'
}, {
dataField: 'price',
text: 'Product Price'
}];
const sourceCode = `\
<BootstrapTableful keyField='id' data={ [] } columns={ columns } noDataIndication="Table is Empty" />
// Following is more customizable example
function indication() {
// return something here
}
<BootstrapTableful keyField='id' data={ [] } columns={ columns } noDataIndication={ indication } />
`;
export default () => (
<div>
<BootstrapTableful keyField="id" data={ [] } columns={ columns } noDataIndication="Table is Empty" />
<Code>{ sourceCode }</Code>
</div>
);