Skip to content

Instantly share code, notes, and snippets.

@AllenFang
Created February 18, 2017 14:48
Show Gist options
  • Select an option

  • Save AllenFang/910ab7e5b2f722a23ffc4eefa8056bd8 to your computer and use it in GitHub Desktop.

Select an option

Save AllenFang/910ab7e5b2f722a23ffc4eefa8056bd8 to your computer and use it in GitHub Desktop.
class ExpandRow extends React.Component {
constructor(props) {
super(props);
}
isExpandableRow(row) {
if (row.id < 2) return true;
else return false;
}
expandComponent(row) {
return (
<BSTable data={ row.expand } />
);
}
render() {
const options = {
expandRowBgColor: 'rgb(242, 255, 163)'
};
return (
<BootstrapTable data={ products }
options={ options }
striped
expandableRow={ this.isExpandableRow }
expandComponent={ this.expandComponent }
search>
<TableHeaderColumn dataField='id' isKey>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name'>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
}
@odenysiuk

Copy link
Copy Markdown

Could you please add definition of BSTable react component because it is confuses a lot. Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment