Skip to content

Commit

Permalink
feat: action text NewbeeFE#16
Browse files Browse the repository at this point in the history
  • Loading branch information
OnedayLiu committed Oct 17, 2017
1 parent 265a3db commit 439a1cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ Pixels to offset from bottom when calculating position of scroll
show select columns or not, default is true
### `actionText:` string
action header title, default is 'Action'
## FAQ
### How to trigger the `onSearch` action imperatively?
Expand Down
6 changes: 4 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface IDataTableProps {
title?: React.ReactNode,
searchBtnText?: string,
clearBtnText?: string,
actionText?: string,
listSelectionBtnText?: string,
/** 最大的表单项显示数,当表单项超过此数值时,会自动出现 collapse 按钮 */
maxVisibleFieldCount?: number,
Expand Down Expand Up @@ -176,10 +177,11 @@ export class DataTable extends React.Component<IDataTableProps, IDataTableState>
searchBtnText: 'Search',
clearBtnText: 'Clear',
listSelectionBtnText: 'List selection',
showSelectColumns: true
showSelectColumns: true,
actionText: 'Action'
}

readonly actionsColumn = this.props.rowActions && { key: 'actions', title: 'Actions', render: (record) => { return renderActions(this.props.rowActions as RowAction[], record) } } as TableColumnConfig<any>
readonly actionsColumn = this.props.rowActions && { key: 'actions', title: this.props.actionText, render: (record) => { return renderActions(this.props.rowActions as RowAction[], record) } } as TableColumnConfig<any>

readonly shouldShowTableTitle = this.props.title || this.props.enableListSelection

Expand Down

0 comments on commit 439a1cf

Please sign in to comment.