Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #29 from mojo706/ft-extend-config
Browse files Browse the repository at this point in the history
Feature: Extend mui-data-table config object to add viewSearchBarOnload property
  • Loading branch information
mojo706 committed Feb 14, 2018
2 parents bd02665 + d6b2b8c commit cf2efbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mui-data-table",
"version": "0.1.5",
"version": "0.1.6",
"description": "Data table for react material-ui",
"repository": {
"type": "git",
Expand Down
5 changes: 3 additions & 2 deletions src/lib/mui-data-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default class MuiDataTable extends React.Component {
super();
let tableData = props.config.data || [];
let rowsPerPage = props.config.paginated.constructor === Object ? props.config.paginated.rowsPerPage : 5;
let viewSearchBarOnload = props.config.viewSearchBarOnload || false;

tableData = props.config.paginated ? new Paginate(tableData).perPage(rowsPerPage) : tableData;

Expand All @@ -69,15 +70,15 @@ export default class MuiDataTable extends React.Component {

this.state = {
disabled: true,
style: searchStyle,
style: viewSearchBarOnload ? {...searchStyle, opacity: 1} : searchStyle,
idempotentData: props.config.data,
paginatedIdempotentData: new Paginate(props.config.data),
perPageSelection: props.config.paginated.rowsPerPage || 5,
tableData: tableData,
searchData: [],
isSearching: false,
navigationStyle,
iconStyleSearch
iconStyleSearch: iconStyleSearch
};

this.columns = injectProp(props.config.columns);
Expand Down

0 comments on commit cf2efbc

Please sign in to comment.