Skip to content

Commit 1ef006e

Browse files
committed
add README.md
1 parent 42339b7 commit 1ef006e

File tree

5 files changed

+168
-11
lines changed

5 files changed

+168
-11
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# react-bootstrap-table2-editor
2+
3+
`react-bootstrap-table2` separate the cell edit code base to [`react-bootstrap-table2-editor`](https://github.com/react-bootstrap-table/react-bootstrap-table2/tree/develop/packages/react-bootstrap-table2-editor), so there's a little bit different when you use cell edit than `react-bootstrap-table`. In the following, we are going to show you how to enable the cell edit
4+
5+
**[Live Demo For Cell Edit](https://react-bootstrap-table.github.io/react-bootstrap-table2/storybook/index.html?selectedKind=Cell%20Editing)**
6+
7+
-----
8+
9+
## Install
10+
11+
```sh
12+
$ npm install react-bootstrap-table2-editor --save
13+
```
14+
15+
## How
16+
17+
We have [two ways](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/cell-edit-props.html#celleditmode-string) to trigger a editable cell as editing cell:
18+
19+
* click
20+
* dbclick
21+
22+
That's look into how we enable the cell edit on tabe:
23+
24+
```js
25+
import cellEditFactory from 'react-bootstrap-table2-editor';
26+
27+
// omit
28+
29+
<BootstrapTable
30+
keyField="id"
31+
data={ products }
32+
columns={ columns }
33+
cellEdit={ cellEditFactory({ mode: 'click' }) }
34+
/>
35+
```
36+
37+
How user save their new editings? We offer two ways:
38+
39+
* Press ENTER(**default**)
40+
* Blur from current editing cell(Need to enable the [cellEdit.blurToSave](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/cell-edit-props.html#celleditblurtosave-bool))
41+
42+
## Editable Cell
43+
`react-bootstrap-table2` support you to configure the cell editable on three level:
44+
45+
* Row Level ([cellEdit.nonEditableRows](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/cell-edit-props.html#celleditnoneditablerows-function))
46+
* Column Level (Configure [column.editable](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/column-props.html#columneditable-bool-function) as bool value)
47+
* Cell Level (Configure [column.editable](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/column-props.html#columneditable-bool-function) as a callback function)
48+
49+
## Customize Style/Class
50+
Currently, we only support the editing cell style/class customization, in the future, we will offer more customizations.
51+
52+
### Editing Cell
53+
54+
* Customize the editing cell style via [column.editCellStyle](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/column-props.html#columneditcellstyle-object-function)
55+
* Customize the editing cell classname via [column.editCellClasses](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/column-props.html#columneditcellclasses-string-function)
56+
57+
## Validation
58+
59+
[`column.validator`](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/column-props.html#columnvalidator-function) will help you to work on it!
Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# react-bootstrap-table2-filter
22

3-
## Filters
3+
`react-bootstrap-table2` separate the filter core code base to [`react-bootstrap-table2-filter`](https://github.com/react-bootstrap-table/react-bootstrap-table2/tree/develop/packages/react-bootstrap-table2-filter), so there's a little bit different when you use column filter than `react-bootstrap-table`. In the following, we are going to show you how to enable the column filter:
44

5-
* Text (`textFilter`)
5+
**[Live Demo For Column Filter](https://github.com/react-bootstrap-table/react-bootstrap-table2/blob/gh-pages-src/storybook/index.html?selectedKind=Column%20Filter)**
66

7-
You can get all of above filters via import and these filters are a factory function to create a individual filter instance.
8-
In addition, for some simple customization reasons, these factory function allow to pass some props.
7+
-----
98

10-
### Text Filter
9+
## Install
10+
11+
```sh
12+
$ npm install react-bootstrap-table2-filter --save
13+
```
14+
15+
You can get all types of filters via import and these filters are a factory function to create a individual filter instance. Currently, we support following filters:
16+
17+
* TextFilter
18+
* **Coming soon!**
19+
20+
## Text Filter
21+
Following is a quick demo for enable the column filter on **Product Price** column!!
1122

1223
```js
1324
import filterFactory, { textFilter } from 'react-bootstrap-table2-filter';
@@ -23,18 +34,20 @@ const columns = [
2334
<BootstrapTable keyField='id' data={ products } columns={ columns } filter={ filterFactory() } />
2435
```
2536

26-
Following we list all the availabe props for `textFilter` function:
37+
In addition, we preserve all of the filter features and functionality in legacy `react-bootstrap-table`, but in different way to do it:
2738

2839
```js
29-
import { Comparator } from 'react-bootstrap-table2-filter';
40+
import filterFactory, { textFilter, Comparator } from 'react-bootstrap-table2-filter';
3041
// omit...
3142

32-
const customTextFilter = textFilter({
43+
const priceFilter = textFilter({
3344
placeholder: 'My Custom PlaceHolder', // custom the input placeholder
34-
style: { ... }, // your custom styles on input
3545
className: 'my-custom-text-filter', // custom classname on input
3646
defaultValue: 'test', // default filtering value
37-
delay: 1000, // how long will trigger filtering after user typing, default is 500 ms
38-
comparator: Comparator.EQ // default is Comparator.LIKE
47+
comparator: Comparator.EQ, // default is Comparator.LIKE
48+
style: { ... }, // your custom styles on input
49+
delay: 1000 // how long will trigger filtering after user typing, default is 500 ms
3950
});
51+
52+
// omit...
4053
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# react-bootstrap-table2-overlay
2+
In `react-bootstrap-table2`, you will be easier to custom the loading or lverlay on table no matter if remote enabled or not. In the following, we have two way to do it:
3+
4+
-----
5+
6+
## Empty Table
7+
[**`noDataIndication`**](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/table-props.html#nodataindication-function) is a simple case you can take it, if current data size is empty, `react-bootstrap-table2` will call the `noDataIndication` prop and get the result to display on the table.
8+
9+
[**Here**](https://react-bootstrap-table.github.io/react-bootstrap-table2/storybook/index.html?selectedKind=EmptyTableOverlay) is a quick exmaple for `noDataIndication`.
10+
11+
## Loading Table
12+
In the most of case for remote mode, you need the loading animation to tell the user the table is loading or doing some action in the background. Hence, you can lervarge [**`overlay`**](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/table-props.html#overlay-function) prop.
13+
14+
[**Here**](https://react-bootstrap-table.github.io/react-bootstrap-table2/storybook/index.html?selectedKind=EmptyTableOverlay) is also a example for `overlay`
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# react-bootstrap-table2-pagination
2+
3+
`react-bootstrap-table2` separate the pagination code base to [`react-bootstrap-table2-pagination`](https://github.com/react-bootstrap-table/react-bootstrap-table2/tree/develop/packages/react-bootstrap-table2-paginator), so there's a little bit different when you use pagination. In the following, we are going to show you how to enable and configure the a pagination table
4+
5+
**[Live Demo For Pagination](https://react-bootstrap-table.github.io/react-bootstrap-table2/storybook/index.html?selectedKind=Pagination)**
6+
7+
-----
8+
9+
## Install
10+
11+
```sh
12+
$ npm install react-bootstrap-table2-pagination --save
13+
```
14+
15+
## How
16+
17+
Let's enable a pagination on your table:
18+
19+
```js
20+
import paginator from 'react-bootstrap-table2-paginator';
21+
// omit...
22+
23+
<BootstrapTable keyField='id' data={ products } columns={ columns } pagination={ paginator() } />
24+
```
25+
26+
## Customization
27+
28+
See [pagination props](https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/pagination-props.html)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# react-bootstrap-table-next
2+
Next generation of [`react-bootstrap-table`](https://github.com/AllenFang/react-bootstrap-table)
3+
4+
## Usage
5+
6+
### Installation
7+
8+
```sh
9+
npm install react-bootstrap-table-next --save
10+
```
11+
12+
### Include CSS
13+
14+
> react-bootstrap-table2 need you to add bootstrap css in your application firstly. About bootstrap css, we only compatible with bootstrap 3 but will start to compatible for bootstrap 4 on v0.2.0
15+
16+
```js
17+
// es5
18+
require('react-bootstrap-table-next/dist/react-bootstrap-table2.min.css');
19+
20+
// es6
21+
import 'react-bootstrap-table-next/dist/react-bootstrap-table2.min.css';
22+
```
23+
24+
### Your First Table
25+
26+
```js
27+
import BootstrapTable from 'react-bootstrap-table-next';
28+
29+
const products = [ ... ];
30+
const columns = [{
31+
dataField: 'id',
32+
text: 'Product ID'
33+
}, {
34+
dataField: 'name',
35+
text: 'Product Name'
36+
}, {
37+
dataField: 'price',
38+
text: 'Product Price'
39+
}];
40+
41+
export default () =>
42+
<BootstrapTable keyField='id' data={ products } columns={ columns } />
43+
```

0 commit comments

Comments
 (0)