Skip to main content

TableCell

TableCell is a field rendering component for tables. It is used to render different types of fields

When To Use

  • When you need to use some of the field component capabilities of Gitee Team
  • When a business table needs to be rendered

Properties

keyValue TypeProperty ExplanationRequired or Not
typestringType of the component (see below for specific enumeration values)true
textarray / stringThe value of the component. checkbox is arraytrue
idstringItem ObjectIdfalse
dataIndexstringThe id of the component, as long as it is uniquefalse
readonlybooleanWhether the component is read-onlyfalse

Type

  • Actors: the role user
  • Annex: Attachment
  • Assignee: the person in charge
  • Checkbox: checkbox
  • DataQuote: data reference
  • Date: Date
  • Dropdown: Dropdown option
  • Editor: Rich Text Editor
  • File: File
  • Formula: Formula
  • ItemType: Type
  • Key: matter key
  • LongText:Long Text
  • Name: item title
  • Number:Value
  • Priority:priority
  • Radio:Radio
  • Script: Script
  • Sprint: Iteration
  • Status: Status
  • Tag: Tag
  • Text: Text
  • Tree: Tree component
  • User: user
  • Version: Version

Example

import { Table, OverflowTooltip } from 'antd';
import { TableCell } from '@giteeteam/apps-team-components';

const AgileBoardListPage = () => {
const columns = [
{
title: 'name',
dataIndex: 'name',
key: 'name',
width: '40%',
ellipsis: true,
render: text => (
<OverflowTooltip title={text} maxline={1}>
{text}
</OverflowTooltip>
),
},
{
title: 'Created By',
dataIndex: 'createdBy',
key: 'createdBy',
ellipsis: true,
render: (value, row) => (
<TableCell
type={'User'}
text={[value]}
id={row.objectId}
dataIndex={'createdBy'}
readonly
/>
),
},
{
title: 'Workspace',
dataIndex: 'workspace',
key: 'workspace',
ellipsis: true,
render: (value, row) => (
<TableCell
type={'Workspace'}
text={value}
id={row.objectId}
dataIndex={'workspace'}
readonly
/>
),
},
];

return (
<Table
rowKey="objectId"
columns={columns}
dataSource={[]}
/>
)
}