Skip to content

Commit

Permalink
example for #1562
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Aug 21, 2017
1 parent cd93a3f commit fced9fa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/js/column/column-title-table.js
Expand Up @@ -20,12 +20,17 @@ function addProducts(quantity) {
addProducts(5);

export default class ColumnAlignTable extends React.Component {

customTitle(cell, row) {
return `${row.name} for ${cell}`;
}

render() {
return (
<BootstrapTable data={ products }>
<TableHeaderColumn dataField='id' isKey={ true }>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='id' isKey={ true } columnTitle={ this.customTitle } >Product ID</TableHeaderColumn>
<TableHeaderColumn dataField='name' headerTitle={ false } columnTitle={ true }>Product Name</TableHeaderColumn>
<TableHeaderColumn dataField='price' columnTitle={ true } headerText='Custom Title'>Product Price</TableHeaderColumn>
<TableHeaderColumn dataField='price' columnTitle='Hard code string' headerText='Custom Title'>Product Price</TableHeaderColumn>
</BootstrapTable>
);
}
Expand Down

0 comments on commit fced9fa

Please sign in to comment.