1.3.9 • Published 8 years ago

react-touchable-tabular v1.3.9

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

React Touchable Tabular

NPM version Build status Dependency Status Downloads

A React Component to used to view tabular data based on facebook/fixed-data-table.

Installation

$ npm install react-touchable-tabular --save

Requirement

Before using this module, please make sure you have installed manually the following modules:

  • react
  • react-dom
  • momentjs namely moment from NPM

Note: The above 3 modules is peer dependencies, as well as the webpack externals to reduce the generated bundle size.

Usage

import React from 'react';
import Tabular from 'react-touchable-tabular';

class ExampleApp extends React.Component {
  async getDataSource() {
    return await getList();
  }
  render() {
    return (
      <Tabular getDataSource={this.getDataSource}
        tableHeight={1000}
        tableWidth={800}
        columns={[
          {
            title: 'first name',
            key: 'name.first'
          },
          {
            title: 'last name',
            key: 'name.last'
          },
          {
            title: 'created',
            key: 'created',
            type: 'date'
          }
        ]}
      />
    );
  }
}

Why not fixed-data-table directly?

We build the following features based on fixed-data-table:

  • provides touchable to view your data on iPad, Android Pad devices
  • provides sortable column by default and supports dot namespace for sorting key
  • provides an array property columns to render your column data with less code
  • provides a property type
    • if type is "date", this component will format the date by using momentjs
    • if type is "bool", this component will format the value to Yes or No
  • with auto computation on the width values of every columns based on the total width.

License

MIT

1.3.9

8 years ago

1.2.9

8 years ago

1.2.8

8 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago