virtualizedtableforantdnested

The virtualized table component for ant design4, using typescript. Supports nested table rows.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
virtualizedtableforantdnested
001.1.4a year agoa year agoMinified + gzip package size for virtualizedtableforantdnested in KB

Readme

The virtualized table component for AntD4,fast, restorable and smallest size for gzip!
npm dm license
NPM
  • Install

```shell npm i --save virtualizedtableforantd4 ```
```typescript interface vtopts {
id?: number;
/**
 * @default 5
 */
overscanRowCount?: number;

/**
 * this only needs the scroll.y
 */
scroll?: {
  y: number;
};

/**
 * wheel event(only works on native events).
 */
onScroll?: ({ left, top, isEnd, }:
  { top: number; left: number; isEnd: boolean }) => void;

initTop?: number;

/**
 * @default false
 */
debug?: boolean;


// pass -1 means scroll to the bottom of the table
ref?: React.MutableRefObject<{
  scrollTo: (y: number) => void;
}>
} ```
  • Quick start
> You need to change your style like following if your Table.size is not default.
> 如果你的Table.size不是默认的话,你需要修改像下面一样的style。
```less // size={'small'} ant-table vt
> table > .ant-table-tbody > tr > td {
padding: 8px;
} `` ``typescript import React from 'react'; import { Table } from 'antd'; import { useVT } from 'virtualizedtableforantd4';
const vt, setcomponents = useVT(() => ({ scroll: { y: 600 } }), );
scroll={{ y: 600 }} // It's important for using VT!!! DO NOT FORGET!!! components={vt} columns={/*your columns*/} dataSource={/*your data*/} /> ```
  • Scroll to
- scroll-to
  • Restoring last state

- reload
  • Editable Table

- CustomRows Hooks - Editable Rows
  • Drag soring

- Drag soring

License

MIT