Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fast-table

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-table

react table fast

  • 1.4.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-42.86%
Maintainers
1
Weekly downloads
 
Created
Source

fast-table

React表格组件,支持多数据首次快速渲染。

在线Demo

https://paul-long.github.io/react-components/

安装

npm install fast-table --save-dev

支持

  • 多数据快速渲染,虚拟渲染
  • 固定表头
  • 固定列
  • 表头排序
  • 表头分组
  • 树形数据展示
  • 固定行至顶部或者底部
  • 子表格订制

API

Table Props

propsdescribetypedefault value
borderedshow borderedBooleanfalse
classNamecustom classString
colMinWidthmin column widthNumber100
columnsset table headerArray[]-
dataSourcedataArray[]
defaultShowCountdefault show rowsNumber30
emptyTextempty showFunction() => '暂无数据'
expandedRowByClickon click row expandedBooleantrue
expandedRowKeysexpanded rowsString[]
expandedRowRenderexpanded renderFunction
fixedHeaderfixed headerBooleantrue
footerHeightFooter heightNumber30
getRowHeightspan rowFunction(record, index):Number() => 1
headerRowHeightheader row heightNumber35
indentSizeexpanded indent sizeNumber17
onExpandedRowsChangeon expanded changeFunction
onScrollEndscroll to bottomFunction
refreshEnableuse scroll endBooleantrue
rowClassNamerow classNameFunction() => ''
rowHeightdefault row heightNumber30
scrollEndPositionscroll to bottom px to refreshNumber60
showHeadershow headerBooleantrue
sortMultimulti sort enableBooleanfalse
styletable styleObject{}
useScrollYuse y ScrollBooleantrue

Column Props

propsdescribetypedefault value
alignalignmentString(left or center or right)left
classNameset classNameStringorFunction(column, record, index):String
childrenchild columnsObject:Column
dataIndexdata key,use a.b.cString-
fixedfixed columnString(left or right)
keyunique identifier
(can ignore)
String-
onCellcell styleFunction(column, record):Object
orderdefault orderString(desc or asc)
renderrender cellFunction(text, record, index) {}-
sortEnablesort enableBoolean
titleheader cell textString or ReactNode
widthwidthString or Number-

DataSource Props:

propsdescribetypedefault value
isFixedfixed rowtrue or String(top or bottom )-

示例

import Table from 'fast-table';
const columns = [
  {
    title: '第一列',
    align: 'left',
    dataIndex: 'key',
    sortEnable: true,
    order: true,
    fixed: 'left',
    width: 100,
    render: (text) => (<span>{text}</span>),
    onCell: () => ({color: '#F9C152'})
  },
  {
    title: '第二列',
    dataIndex: 'key0',
    width: 100,
    fixed: 'left',
    sortEnable: true
  },
  {
    title: '第三列',
    dataIndex: 'key1',
    width: 100,
    bodyStyle: {background: '#122024', color: '#11A1FF'}
  },
  {
    title: '第四列',
    align: 'left',
    dataIndex: 'key2',
    width: 130
  },
  {
    title: '第五列',
    align: 'left',
    dataIndex: 'key3',
    width: 120
  },
  {
    title: '第六列',
    align: 'left',
    fixed: 'right',
    dataIndex: 'key4',
    width: 100,
  }
];

const dataSource = [
  {key: 0, key0: 'a', key1: 'b', key2: 'c', key3: 'd', key4: 'e'}
];
const otherProps = {};
ReactDOM.render(<Table columns={columns} dataSource={dataSource} {...otherProps} />, mountNode);

查看更多实例

Keywords

FAQs

Package last updated on 09 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc