react-bootstrap-table icon indicating copy to clipboard operation
react-bootstrap-table copied to clipboard

cannot seem to provide customEditor parameter

Open riguy724 opened this issue 10 years ago • 2 comments

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>

riguy724 avatar Oct 11 '16 15:10 riguy724

Default view (must edit two fields here, that are displayed in aggregate in dataFormat

screenshot from 2016-10-11 11 38 56

In edit mode screenshot from 2016-10-11 11 39 13

riguy724 avatar Oct 11 '16 15:10 riguy724

Nevermind, on wrong version of react!

riguy724 avatar Oct 11 '16 15:10 riguy724