From d18688602e03588328f94d3e33ec47f59358cbef Mon Sep 17 00:00:00 2001 From: ES Date: Tue, 4 Jun 2019 16:44:51 +0530 Subject: [PATCH 1/2] Modified schema object keys --- README.md | 7 ++++--- demo/src/schema/basic.js | 10 +++++----- src/Renderer/Body/Date.js | 6 +++--- src/Renderer/Body/Options.js | 6 +++--- src/Renderer/Body/Text.js | 6 +++--- src/createTable.js | 10 +++++----- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 93f55cc..32dd9cb 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ using REST API. - Pagination - Sortable columns - Configurable column widths +- Editable table - Built in windowing to handle large dataset with thousands of rows - Customizable limiter options - Customizable toolbar with the ability to add custom renderers @@ -217,8 +218,8 @@ const YourComponent = () => | toolbar | array | false | \[] | Toolbar definition (Check below) | | columns | array | true | - | Columns to display | | styles | object | false | {} | Custom styles for your table | -| isEditable | boolean | false | {} | Set whether the table is editable | -| isEditing | boolean | false | {} | Set the default state of the table to be in editing mode | +| editable | boolean | false | {} | Set whether the table is editable | +| editing | boolean | false | {} | Set the default state of the table to be in editing mode | | primaryKey | string | true | {} | Set the primary key column of the table for actions like editing. | #### Pagination object @@ -278,7 +279,7 @@ Note: action of type "editable" is required when you set the table to be editabl | label | string | true | - | Label for the column | | sortable | boolean | false | true | Whether the column is sortable | | filterable | boolean | false | true | Whether the column is filterable | -| isEditable | boolean | false | false | When the table is set to be editable, set whether the respective column is among the editable | +| editable | boolean | false | false | When the table is set to be editable, set whether the respective column is among the editable | | visible | boolean | false | true | Whether the column is visible on load | | type | string | true | string | Available types: selection, number, date, string, image, options, actions | | width | integer | true | - | Width of the column | diff --git a/demo/src/schema/basic.js b/demo/src/schema/basic.js index a78fb66..80828f0 100644 --- a/demo/src/schema/basic.js +++ b/demo/src/schema/basic.js @@ -6,8 +6,8 @@ export default { rowHeight: 50, filterable: true, headers: true, - isEditable: true, - isEditing: false, + editable: true, + editing: false, primaryKey: 'pageId', // styles: { // loader: { @@ -222,7 +222,7 @@ export default { width: 150, filterable: true, sortable: true, - // isEditable: true + // editable: true }, { label: "Status", type: "options", @@ -250,7 +250,7 @@ export default { "label": "Archived" } }, - isEditable: true + editable: true // renderer: ({ // data, // colConfig: { name, options } @@ -262,7 +262,7 @@ export default { sortable: true, textAlign: 'left', width: 200, - isEditable: true, + editable: true, filterable: true, }, { label: 'Actions', diff --git a/src/Renderer/Body/Date.js b/src/Renderer/Body/Date.js index f730840..c017314 100644 --- a/src/Renderer/Body/Date.js +++ b/src/Renderer/Body/Date.js @@ -10,11 +10,11 @@ const Date = ({ isEditing, handleChange, modifiedData, - colConfig: { name, textAlign, format, isEditable } + colConfig: { name, textAlign, format, editable } }) => ( - { (!isEditable || !isEditing) &&