Packages

A set of simple Surface components based on ant-design.

Current section

Files

Jump to
live_antd lib components table antd_table.ex
Raw

lib/components/table/antd_table.ex

defmodule LiveAntd.Components.AntdTable do
@moduledoc """
## API
### Table
* [ ] `bordered` Whether to show all table borders boolean false
* [ ] `columns`: Columns of table ColumnsType[] -
* [ ] `components`: Override default table elements TableComponents -
* [ ] `dataSource`: Data record array to be displayed object[] -
* [ ] `expandable`: Config expandable content expandable -
* [ ] `footer`: Table footer renderer function(currentPageData) -
* [ ] `getPopupContainer`: The render container of dropdowns in table (triggerNode) => HTMLElement () => TableHtmlElement
* [ ] `loading`: Loading status of table boolean | object (more) false
* [ ] `locale`: The i18n text including filter, sort, empty text, etc object filterConfirm: Ok
* [ ] `pagination`: Config of pagination. You can ref table pagination config or full pagination document, hide it by setting it to false object -
* [ ] `rowClassName`: Row's className function(record, index): string -
* [ ] `rowKey`: Row's unique key, could be a string or function that returns a string string | function(record): string key
* [ ] `rowSelection`: Row selection config object -
* [ ] `scroll`: Whether the table can be scrollable, config object -
* [ ] `showHeader`: Whether to show table header boolean true
* [ ] `showSorterTooltip`: The header show next sorter direction tooltip boolean true
* [ ] `size`: Size of table default | middle | small default
* [ ] `sortDirections`: Supported sort way, could be ascend, descend Array [ascend, descend]
* [ ] `sticky`: Set sticky header and scroll bar boolean | {offsetHeader?: number, offsetScroll?: number, getContainer?: () => HTMLElement} - 4.6.0 (getContainer: 4.7.0)
* [ ] `summary`: Summary content (currentData) => ReactNode -
* [ ] `tableLayout`: The table-layout attribute of table element - | auto | fixed -
* [ ] `fixed`: when header/columns are fixed, or using column.ellipsis
* [ ] `title`: Table title renderer function(currentPageData) -
* [ ] `onChange`: Callback executed when pagination, filters or sorter is changed function(pagination, filters, sorter, extra: { currentDataSource: [], action: paginate | sort | filter }) -
* [ ] `onHeaderRow`: Set props on per header row function(column, index) -
* [ ] `onRow`: Set props on per row
## Example
<AntdTable
dataSource={{@data}}
columns={{@columns}}
/>
"""
end