mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-10-05 09:37:33 +00:00
Implement stateful layer (#48)
* implement an internal stateful layer for data change(update/insert/delete) * BootstrapTable -> BootstrapTableful
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
+3
-3
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user