smart-grid-g
Advanced tools
Weekly downloads
Readme
Dynamically and configurable column properties with Multiview support of table component based on antd with React
online example: https://favori.gitee.io/gantd-landing (CodePen)
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);
GantFDT
MIT
FAQs
gantd smart-grid-g
The npm package smart-grid-g receives a total of 48 weekly downloads. As such, smart-grid-g popularity was classified as not popular.
We found that smart-grid-g demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.