gimstable
A React Table component for GIMS
Last updated 4 years ago by chrimmme .
ISC · Original npm · Tarball · package.json
$ cnpm install gimstable 
SYNC missed versions from official npm registry.

GIMSTable

A React Table Component for the SA GIMS System

Highlight Features:

  • Support custom sorting function
  • Support column width adjust & auto fit to content
  • Support select, deselect
  • Support native click, double click callbacks

Usage:

Install:

Install from npm:

   $ npm install gimstable

Please include the gimstable.css from style/ into your page / build system

Install from Script Tag

   <script src="https://fb.me/react-15.0.2.js"></script>
   <script src="https://fb.me/react-dom-15.0.2.js"></script>
   <script src="./node_modules/gimstable/node_modules/fixed-data-table/dist/fixed-data-table.js"></script>
   <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.min.js"></script>
   <script src="./node_modules/gimstable/dist/gimstable.js"></script>
   <link rel="stylesheet" type="text/css" href="./node_modules/gimstable/style/gimstable.css">

*** Please use GIMSTable.default instead of GIMSTable *** :

    var GIMSTable = GIMSTable.default;

Use:

ES6 Import:

    import GIMSTable from 'gimstable';

ES5 Require:

    var GIMSTable = require('gimstable').default;

Use it in your React Component:

    <GIMSTable data={data} keys={keys} headers={headers} selected={selected} tableHeight={500} tableWidth={400} />

Props:

  • data required``````array: the array of data you want to display
  • headers required``````array : the array of headers
  • keysarray : the array of keys to extract information from the data, default to be the lowercase and space-removed version of header
  • clickCallback function: callback you want to fireup when clicking the row, will pass the clicked row index to the callback function
  • doubleClickCallback function : callback you want to fireup when double-clicking the row, will pass the clicked row index to the callback function
  • sortCallback function : callback you want to fireup when clicking the header, it is up to the client code to decide what to do when sorting, will pass sortkey, sortkey index and descending to the function
  • tableHeight number : the height of the table
  • tableWidth number : the width of the table

APIs:

  • getSelected : Return all the selected index in an array
  • getClicked : Return the last clicked index

Example:

Refer to the example folder

Current Tags

  • 1.1.4                                ...           latest (4 years ago)

13 Versions

  • 1.1.4                                ...           4 years ago
  • 1.1.3                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (3)
Dev Dependencies (14)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |