Add defaultExpanded prop

This commit is contained in:
Aaron Schwartz
2017-05-10 15:52:34 -07:00
parent cfdc688501
commit 6be71dc4a1
2 changed files with 3 additions and 2 deletions

View File

@@ -22,6 +22,7 @@ export default {
defaultSorting: [],
showFilters: false,
defaultFilters: [],
defaultExpanded: {},
defaultFilterMethod: (filter, row, column) => {
const id = filter.pivotId || filter.id
return row[id] !== undefined ? String(row[id]).startsWith(filter.value) : true

View File

@@ -33,9 +33,9 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
this.state = {
page: 0,
pageSize: props.defaultPageSize || 10,
pageSize: props.defaultPageSize,
sorting: props.defaultSorting,
expandedRows: {},
expandedRows: props.defaultExpanded,
filters: props.defaultFilters,
resizing: props.defaultResizing,
currentlyResizing: false,