Skip to content

Commit

Permalink
Add option plain to wrap only the provided table column
Browse files Browse the repository at this point in the history
This means that bootstrap grid will not be used, and that page size,
pagination, and filter components will not be added. You can add them in
your component with PageSizeContainer, PaginationContainer, and
FilterContainer components.
  • Loading branch information
amir-hadzic committed Oct 26, 2017
1 parent 01e768b commit f1f2f83
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ You can style these components with `style` or `className`.

### Configuration properties:

- _plain_ if you want only the table component to be returned without page size, pagination, or filter (will not use bootstrap grid)
- _showPageSize_ if page size select should be shown
- _showFilter_ if text filter field should be shown
- _defaultPageSize_ overrides the default page size (if not specified 5 will be used)
Expand Down
14 changes: 14 additions & 0 deletions src/sematable.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,20 @@ const sematable = (tableName, TableComponent, columns, configs = {}) => {
select,
};

if (configs.plain) {
return (
<TableComponent
{...otherProps}
data={visibleRows}
headers={headers}
primaryKey={primaryKey}
columns={columns}
filter={filter}
{...configs}
/>
);
}

return (
<div className="row">
<div className={pageSizeContainerClassName}>
Expand Down

0 comments on commit f1f2f83

Please sign in to comment.