react-bootstrap-table
react-bootstrap-table copied to clipboard
cannot seem to provide customEditor parameter
I am just trying to get started with building a customEditor for I am specifying this on my table, but all that appears is the normal editable box that appears by default for editable boxes. Any idea what's going wrong here?
class ResultsLinkEditor extends React.Component {
constructor(props) {
super(props);
this.updateData = this.updateData.bind(this);
}
updateData() {
console.log('calling update data');
this.props.onUpdate('some stuff');
}
render() {
return (
<div onClick={this.updateData}>edit things</div>
);
}
}
const createResultsLinkEditor = (onUpdate, props) => (<ResultsLinkEditor onUpdate={ onUpdate } {...props}/>);
<BootstrapTable
keyField="guid"
remote={true}
striped={true}
options = {{
defaultSortName: 'created_date',
defaultSortOrder: 'desc'
}}
cellEdit={{
mode: 'dbclick',
beforeSaveCell: this.beforeSaveCell,
afterSaveCell: this.afterSaveCell
}}
data={this.props.data}>
<TableHeaderColumn
ref='thheader_results'
key='results'
editable={!this.props.isUpdatingReport}
customEditor={{getElement: createResultsLinkEditor }}
dataField='results'
dataAlign='center'
width='200px'
dataFormat={this.resultsFormat}>
Results
</TableHeaderColumn>
Default view (must edit two fields here, that are displayed in aggregate in dataFormat

In edit mode

Nevermind, on wrong version of react!