Coder Social home page Coder Social logo

leevare / cs-table Goto Github PK

View Code? Open in Web Editor NEW

This project forked from j4dream/cs-table

0.0 0.0 0.0 20.18 MB

High performance table, react component

Home Page: https://j4dream.github.io/cs-table/

HTML 2.98% CSS 2.49% JavaScript 28.16% TypeScript 66.36% Shell 0.01%

cs-table's Introduction

CS Table, virtualized Table

Supports large amounts of data, built using react hooks.

image

Install

npm i virtualized-sc-table
// or
yarn add virtualized-sc-table

文档 Docs
CTable Online Demo
STable Online Demo

import { CTable, STable } from 'virtualized-sc-table';

const header = [
  {
    label: 'Operation',
    fixed: true,
    prop: 'op',
    width: 90,
    renderHeader: (h, p) => <a href="#">Operation</a>,
    renderCell: () => <a href="#">OP</a>,
  },
  {
    label: 'Email (Fixed)',
    fixed: true,
    prop: 'email',
  },
];
for (let i = 0; i < 200; i++) {
  header.push({
    label: `H ${i}`,
    prop: `${i}`,
  });
}

const data = [];
for (let r = 0; r < 10000; r++) {
  const row = {};
  for (let c = 0; c < 200; c++) {
    row[c] = `data ${r}:${c}`;
  }
  row['email'] = `test_${r}@email.com`;
  data.push(row);
}

<CTable
  header={header}
  data={data}
  // renderCell={(record, prop) => record[prop]}
  // renderHeader={(header, prop) => header[prop]}
/>;

STable

Sheet can support grouping column header and row header.

props default Desc
colHeader: Array [] required *, table header [{ label: 'Name', prop: 'name' }]
rowHeader: Array [] required *, table header [{ label: 'Name', prop: 'name' }]
data: Array [] required *, tabel data [{ name: 'DDR' }]
renderCell: Function (record, rowProp, colProp, data) => record
cellWidth: number 100 config cell Width
cellHeight: number 40 config cell Height
enableColResize: boolean false support resize col
enableColSorting: boolean false support drag & drog to sort colunm header
enableRowResize: boolean false support resize col
enableRowSorting: boolean false support drag & drog to sort row headr

CTable

props default Desc
header: Array [] required *, table header [{ label: 'Name', prop: 'name' }]
data: Array [] required *, tabel data [{ name: 'DDR' }]
preventScroll: Boolean false toggle scroll, prevent scroll
keepScrollStatus: Boolean false when data or header update, keep scroll status, ortherwise scroll to {0, 0}
enableResize: Boolean false resize col width
renderCell: Function (record, rowIndex, prop, header) => record
renderHeader: Function (header, prop) => header.label

cs-table's People

Contributors

j4dream avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.