Skip to content

Commit 9d0d098

Browse files
committed
added examples.md
1 parent 0b5a150 commit 9d0d098

File tree

8 files changed

+20
-3
lines changed

8 files changed

+20
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import { ReactTabulator } from 'react-tabulator'; // for React 15.x, use import
4444

4545
- Code Example: [/src/ReactTabulatorExample.tsx](/src/ReactTabulatorExample.tsx)
4646
- Code Example (React 15.x): [Codesandbox](https://codesandbox.io/s/0mwpy612xw?module=/src/components/Home.js)
47+
- [More Codesandbox Examples](/docs/examples.md)
4748

4849
### 🔧 Commands
4950

TODO.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ React Tabulator
55
### Todo
66

77
- [ ] example for Add Row
8+
- [ ] add / generate more types
89

910
### In Progress
1011

1112
- [ ] upgrade dependencies
1213

1314
### Done ✓
1415

16+
- [x] add more Codesandbox examples
1517
- [x] capture a GIF demo
1618
- [x] remove date-fns
1719
- [x] add TODO.md

docs/examples.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Examples
2+
3+
React-tabulator version may not be the latest in these examples.
4+
5+
- Code Example: [/src/ReactTabulatorExample.tsx](/src/ReactTabulatorExample.tsx)
6+
- Code Example (React 15.x): [Codesandbox](https://codesandbox.io/s/0mwpy612xw?module=/src/components/Home.js)
7+
8+
Columns:
9+
- Dynamically set columns - [Link](https://codesandbox.io/s/react-tabulator-examples-6ldg3?file=/src/components/Home.js)
10+
11+
Data:
12+
- Dropdown to filter table data - [Link](https://codesandbox.io/s/react-tabulator-examples-vs7vq?file=/src/components/Home.js)

lib/ConfigUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ exports.propsToOptions = function (props) {
1010
'resizableColumns', 'resizableRows', 'autoResize', 'tooltips', 'tooltipsHeader', 'tooltipGenerationMode',
1111
'initialSort', 'initialFilter', 'initialHeaderFilter', 'footerElement', 'index', 'keybindings', 'clipboard', 'clipboardCopyStyled',
1212
'clipboardCopySelector', 'clipboardCopyFormatter', 'clipboardCopyHeader', 'clipboardPasteParser',
13-
'clipboardPasteAction', 'rowFormatter', 'placeholder'];
13+
'clipboardPasteAction', 'rowFormatter', 'placeholder', 'selectable'];
1414
for (var _i = 0, defaultOptions_1 = defaultOptions; _i < defaultOptions_1.length; _i++) {
1515
var opt = defaultOptions_1[_i];
1616
if (typeof props[opt] !== 'undefined') {

lib/ReactTabulatorExample.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ var editableColumns = [
7070
{
7171
title: 'Pets',
7272
field: 'pets',
73+
sorter: function (a, b) { return a.toString().localeCompare(b.toString()); },
7374
editor: MultiSelectEditor_1["default"],
7475
editorParams: { values: petOptions },
7576
formatter: MultiValueFormatter_1["default"],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-tabulator",
3-
"version": "0.12.1",
3+
"version": "0.12.2",
44
"description": "React Tabulator is based on tabulator - a JS table library with many advanced features.",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",

src/ConfigUtils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const propsToOptions = (props: any) => {
120120
'resizableColumns', 'resizableRows', 'autoResize', 'tooltips', 'tooltipsHeader', 'tooltipGenerationMode',
121121
'initialSort', 'initialFilter', 'initialHeaderFilter', 'footerElement', 'index', 'keybindings', 'clipboard', 'clipboardCopyStyled',
122122
'clipboardCopySelector', 'clipboardCopyFormatter', 'clipboardCopyHeader', 'clipboardPasteParser',
123-
'clipboardPasteAction', 'rowFormatter', 'placeholder']
123+
'clipboardPasteAction', 'rowFormatter', 'placeholder', 'selectable']
124124

125125
for (const opt of defaultOptions) {
126126
if (typeof props[opt] !== 'undefined') {

src/ReactTabulatorExample.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const editableColumns = [
5959
{
6060
title: 'Pets',
6161
field: 'pets',
62+
sorter: (a: string[], b: string[]) => a.toString().localeCompare(b.toString()),
6263
editor: MultiSelectEditor,
6364
editorParams: { values: petOptions },
6465
formatter: MultiValueFormatter,

0 commit comments

Comments
 (0)