A materialized, static table react component to display JSON data
npm install material-editable-tableThis table component provides an ituitive way to view data and edit them.
npm install --save material-editable-tablejavascript
{
tooltip : "id", // The value to be displayed when column header is hovered
readonly : true, // If set to true, this column won't be editable even if the editing props of the table is set
name : "id" // The value displayed on the column header
}
`* items
An array containing data in json format
`javascript
{id: 1, name: "The first line"}
`* showToggle
A boolean value to decide if the editing toggle is shown. Note that this value doesn't affect
editing or editable* editing
A boolean value to decide if the table can be edited initially
* editable
Set this to
true to enable editing feature* [Other Props]
Other props not discussed above will be propegated to Table component from material-ui#Table. You can affect table appearance and behaviors there.
Simple Demostration
* index.html
`html
Main Window
`* main.js
`javascript
import React from 'react'
import {render} from 'react-dom';
import JsonMaterialTable from 'material-editable-table';var column = [
{tooltip: "id", readonly: true, name: "id"},
{tooltip: "name", readonly: false, name: "name"}
];
var row = [
{id: 1, name: "The first line"},
{id: 2, name: "The second line"}
];
render( , document.getElementById("Table"));
``