react-bootstrap-table2/packages/react-bootstrap-table2-example/examples/basic/no-data-table.js
Allen 9f9f78e73b fix #40
* add missing dependenies

* tuning webpack loader for scss

* implement noDataIndication

* add story for noDataIndication prop

* patch yarn.lock
2017-09-02 06:10:24 -05:00

33 lines
797 B
JavaScript

import React from 'react';
import { BootstrapTable } from 'react-bootstrap-table2';
const columns = [{
dataField: 'id',
text: 'Product ID'
}, {
dataField: 'name',
text: 'Product Name'
}, {
dataField: 'price',
text: 'Product Price'
}];
export default () => (
<div>
<BootstrapTable keyField="id" data={ [] } columns={ columns } noDataIndication="Table is Empty" />
<pre className="prettyprint lang-js"><code className="language-javascript">{`
<BootstrapTable keyField='id' data={ [] } columns={ columns } noDataIndication="Table is Empty" />
// Following is more customizable example
function indication() {
// return something here
}
<BootstrapTable keyField='id' data={ [] } columns={ columns } noDataIndication={ indication } />
`}
</code></pre>
</div>
);