Skip to content

Commit

Permalink
feat: Table 默认展示数据项可按column位置展示,不统一在底部展示
Browse files Browse the repository at this point in the history
  • Loading branch information
zrj1031 committed Jul 15, 2020
1 parent 102b34f commit aed8604
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions site/docs/zh-CN/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const columns = [{
title: 'Address',
dataIndex: 'address',
key: 'address',
filtrateDefault: true,
}, {
title: 'Action',
key: 'action',
Expand Down Expand Up @@ -2264,6 +2265,7 @@ ReactDOM.render(<Demo {...context.props}/>,mountNode);
| filtrateTitle | 筛选Checkbox显示文字 | String \| ReactNode | - |
| width | 列宽度 | String \| Number | - |
| ellipsis | 该列是否使用ellipsis属性,需要配合`scroll.x`使用,且指定列宽度,固定列中使用需要指定为像素宽度。 | Boolean | false |
| filtrateDefault | 默认展示数据项,且按column位置展示,不统一在底部展示,区别columnFiltrate.defaultColumns | Boolean | false |

### ColumnGroup

Expand Down
4 changes: 2 additions & 2 deletions source/components/Table/ColumnFiltrateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class ColumnFiltrateModal<T> extends React.Component<ColumnFiltrateProps<T>, Col
this.setState({
checkedOption,
okButtonDisabled: (
JSON.stringify(checkedOption && checkedOption.sort()) ==
JSON.stringify(checkedOption && checkedOption.sort()) ==

This comment has been minimized.

Copy link
@hepeguo

hepeguo Jul 15, 2020

这里看起来可以不变

JSON.stringify(checkedOptionConfirm && checkedOptionConfirm.sort())
)
});
Expand All @@ -137,7 +137,7 @@ class ColumnFiltrateModal<T> extends React.Component<ColumnFiltrateProps<T>, Col
.map((column) => {
const uniqKey = getColumnKey(column);
//fixed /分组不能控制显示隐藏
const disabled = !!column.fixed || !!column.children;
const disabled = !!column.fixed || !!column.children || !!column.filtrateDefault;
const title = column.filtrateTitle || column.title;
return {
label: <ToolTip title={title}>{title}</ToolTip>,
Expand Down
1 change: 1 addition & 0 deletions source/components/Table/interface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface ColumnProps<T> {
onCell?: (record: T) => any;
onHeaderCell?: (props: ColumnProps<T>) => any;
ellipsis?: boolean;
filtrateDefault?: boolean;
}

export interface TableComponents {
Expand Down

1 comment on commit aed8604

@hepeguo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有其他问题

Please sign in to comment.