Implement stateful layer (#48)

* implement an internal stateful layer for data change(update/insert/delete)

* BootstrapTable -> BootstrapTableful
This commit is contained in:
Allen
2017-09-03 02:25:56 -05:00
committed by GitHub
parent 82b827561d
commit ae5c677854
24 changed files with 95 additions and 64 deletions
@@ -1,6 +1,6 @@
import React from 'react';
import { BootstrapTable } from 'react-bootstrap-table2';
import { BootstrapTableful } from 'react-bootstrap-table2';
import Code from 'common/codeBlock';
const products = [];
@@ -31,7 +31,7 @@ const columns = [{
}];
const sourceCode = `\
<BootstrapTable
<BootstrapTableful
keyField="id"
data={ products }
columns={ columns }
@@ -41,7 +41,7 @@ const sourceCode = `\
export default () => (
<div>
<BootstrapTable
<BootstrapTableful
keyField="id"
data={ products }
columns={ columns }
@@ -1,6 +1,6 @@
import React from 'react';
import { BootstrapTable } from 'react-bootstrap-table2';
import { BootstrapTableful } from 'react-bootstrap-table2';
import Code from 'common/codeBlock';
const products = [];
@@ -42,12 +42,12 @@ const columns = [{
text: 'Product Price'
}];
<BootstrapTable keyField='id' data={ products } columns={ columns } />
<BootstrapTableful keyField='id' data={ products } columns={ columns } />
`;
export default () => (
<div>
<BootstrapTable keyField="id" data={ products } columns={ columns } />
<BootstrapTableful keyField="id" data={ products } columns={ columns } />
<Code>{ sourceCode }</Code>
</div>
);
@@ -1,6 +1,6 @@
import React from 'react';
import { BootstrapTable } from 'react-bootstrap-table2';
import { BootstrapTableful } from 'react-bootstrap-table2';
import Code from 'common/codeBlock';
const columns = [{
@@ -15,7 +15,7 @@ const columns = [{
}];
const sourceCode = `\
<BootstrapTable keyField='id' data={ [] } columns={ columns } noDataIndication="Table is Empty" />
<BootstrapTableful keyField='id' data={ [] } columns={ columns } noDataIndication="Table is Empty" />
// Following is more customizable example
@@ -23,12 +23,12 @@ function indication() {
// return something here
}
<BootstrapTable keyField='id' data={ [] } columns={ columns } noDataIndication={ indication } />
<BootstrapTableful keyField='id' data={ [] } columns={ columns } noDataIndication={ indication } />
`;
export default () => (
<div>
<BootstrapTable keyField="id" data={ [] } columns={ columns } noDataIndication="Table is Empty" />
<BootstrapTableful keyField="id" data={ [] } columns={ columns } noDataIndication="Table is Empty" />
<Code>{ sourceCode }</Code>
</div>
);
@@ -1,6 +1,6 @@
import React from 'react';
import { BootstrapTable } from 'react-bootstrap-table2';
import { BootstrapTableful } from 'react-bootstrap-table2';
import Code from 'common/codeBlock';
const products = [];
@@ -31,7 +31,7 @@ const columns = [{
}];
const sourceCode = `\
<BootstrapTable
<BootstrapTableful
keyField="id"
data={ products }
columns={ columns }
@@ -43,7 +43,7 @@ const sourceCode = `\
export default () => (
<div>
<BootstrapTable
<BootstrapTableful
keyField="id"
data={ products }
columns={ columns }