react-sctable
v1.0.7
Published
This is a modulable component to render data in a table with some nice features !
Downloads
27
Readme
react-sctable
This is a modulable component to render data in a table with some nice features !
Install
npm install --save react-sctable
Usage
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import ScTable from 'sctable';
// Basic Example
let options = {
dimensions: {
width: "100%"
},
data: {
columns: [
{
id: "id",
label: "Action",
colClass: "",
unique: {
view: {path: "./view/[AutoPutID]", item: "Preview"},
edit: {path: "./edit/[AutoPutID]", item: "Modify"},
del: {path: "./del/[AutoPutID]", item: "Delete"}
}
},
{
id: "key_1",
label: "Key 1",
colClass: "keyClass1"
},
{
id: "key_2",
label: "Key 2",
colClass: "keyClass2"
},
{
id: "key_3",
label: "Key 3",
colClass: "keyClass3"
},
{
id: "key_4",
label: "Key 4",
colClass: "keyClass4"
},
{
id: "key_5",
label: "Key 5",
colClass: "keyClass5"
},
],
rows: [
{
id: 1,
key_1: "Testing 1",
key_2: "Wording",
key_3: "28/08/2019, 00:00",
key_4: "Test",
key_5: "Test",
},
{
id: 2,
key_1: "Testing 2",
key_2: "Wording",
key_3: "28/08/2019, 00:01",
key_4: "Test",
key_5: "Test",
},
],
}
}
ReactDOM.render(
<ScTable options={options} />,
document.getElementById('root')
);
License
MIT © BananaBb