Socket
Socket
Sign inDemoInstall

smart-grid-g

Package Overview
Dependencies
137
Maintainers
8
Versions
324
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    smart-grid-g

gantd smart-grid-g


Version published
Weekly downloads
63
increased by384.62%
Maintainers
8
Created
Weekly downloads
 

Readme

Source

smart-table-g


Dynamically and configurable column properties with Multiview support of table component based on antd with React

NPM version

Screenshot

Demo

online example: https://favori.gitee.io/gantd-landing (CodePen)

install

rc-tabs

Feature

  • Dynamically and configurable column properties
  • Dynamically configurable table style properties
  • Multi-view support

Usage

import React from 'react';
import SmartTable from 'smart-table-g';
import { Tag, Divider } from 'antd';

function BasicUse() {
  const tableColumns = [
  {
    title: 'name',
    fieldName: 'name',
    render: text => <a>{text}</a>,
  },
  {
    title: 'age',
    fieldName: 'age',
  },
  {
    title: 'address',
    fieldName: 'address',
  },
  {
    title: 'tags',
    fieldName: 'tags',
    render: tags => (
      <span>
        {tags.map(tag => {
          let color = tag.length > 5 ? 'geekblue' : 'green';
          if (tag === 'loser') {
            color = 'volcano';
          }
          return (
            <Tag color={color} key={tag}>
              {tag.toUpperCase()}
            </Tag>
          );
        })}
      </span>
    ),
  },
  {
    title: 'action',
    fieldName: 'action',
    render: (text, record) => (
      <span>
        <a>invite {record.name}</a>
        <Divider type="vertical" />
        <a>delete</a>
      </span>
    ),
  },
]

const dataSource = [
  {
    key: '1',
    name: 'Mr someone1',
    age: 32,
    address: 'custom address',
    tags: ['Otaku', 'Developer'],
  },
  {
    key: '2',
    name: 'Mr someone2',
    age: 42,
    address: 'custom address',
    tags: ['Product manager'],
  },
  {
    key: '3',
    name: 'Mr someone3',
    age: 32,
    address: 'custom address',
    tags: ['Teacher'],
  },
]

  return <div style={{ margin: 10 }}>
      <SmartTable
        tableKey="BasicUse"
        schema={tableColumns}
        dataSource={dataSource}
      />
    </div>
}

React.render(<BasicUse/>, mountNode);

API

Documentation

Contact

Anthor

GantFDT

License

MIT

Keywords

FAQs

Last updated on 18 Mar 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc