1.6.7 • Published 3 years ago

@twister19/twtable v1.6.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

twtable

Reactjs table module

Why to use twtable module ?

Steps to configure twtable in project

import TWTable from "@twister19/twtable";
<TWTable
  headers="{headers}"
  data="{data}"
  filter="{true}"
  pagination="{true}"
  pageSize="{4}"
  heading="Demo Table"
/>
const headers = [{"column": "name","displayname": "Name", "display": true},
{"column": "job","displayname": "Job", "display": true},
{"column": "department","displayname": "Depertment", "display": true},
{"column": "team","displayname": "Team Strenth", "display": true},
{"column": "empId", "display":false},
{"button": true, "displayname":"Button1", "display":true, "column":buttonClicked}];

Headers attributes

NOTE: There can be multiple button type columns in a table

const data = [{"name":"Ashish", "job":"SoftWare Engineer", "department":"MB", "team":3, "empId":1},
{"name":"Nishant","job":"Business","department":"Data2C", "team":4, "empId":2},
{"name":"Mukesh","job":"Banker","department":"Data2C", "team":5, "empId":3},
{"name":"Shashi","job":"Home Maker","department":"Data2C", "team":7, "empId":4},
{"name":"Kanika","job":"Business","department":"Data2C", "team":9, "empId":5}];

Server Side Pagination

Twtable tag

<TWTable
  headers="{headers}"
  data="{getdata}"
  filter="{true}"
  pagination="{true}"
  pageSize="{4}"
  heading="Demo Table"
  serversidePagination="{true}"
/>

'data' will be a function

const getdata = async (twtrequest) => {
  var data = await axios.post(
    "http://yourwebsite.com/api/employee/info",
    twtrequest
  );

  var res = {
    data: data.data.empdata, // Data type Array
    recordCount: 40, // Total record count
  };

  return res;
};

'twtrequest' Strucure

{
  "pageSize": 10,
  "currentpage": 1, // For fist page currentpage will be 0
  "userfilters": { "name": "Ashish", "designation": "developer" },
  "arrangement": { "column": "name", "order": "asc" }
}

Sever-side pagination example

Website Link: https://ashishtondon.github.io/twtable-serversidepaging-demo/

Source Code: https://github.com/AshishTondon/twtable-serversidepaging-demo

To Do List

1.6.7

3 years ago

1.6.6

3 years ago

1.6.4

3 years ago

1.6.5

3 years ago

1.6.3

3 years ago

1.5.4

3 years ago

1.6.2

3 years ago

1.5.3

3 years ago

1.6.1

3 years ago

1.5.2

3 years ago

1.6.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.3

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.2

3 years ago

1.3.0

3 years ago

0.0.1

3 years ago