Skip to content

Instantly share code, notes, and snippets.

@AllenFang
Created April 30, 2017 06:47
Show Gist options
  • Save AllenFang/a8805f699366d3e51f721607b2ce526f to your computer and use it in GitHub Desktop.
Save AllenFang/a8805f699366d3e51f721607b2ce526f to your computer and use it in GitHub Desktop.
const jobs = [];
const jobTypes = [ 'A', 'B', 'C', 'D' ];
const cellEditProp = {
mode: 'click',
blurToSave: true
};
export default class EditTypeReadOnlyTable extends React.Component {
render() {
return (
<BootstrapTable data={ jobs } cellEdit={ cellEditProp } insertRow={ true }>
<TableHeaderColumn dataField='id' isKey={ true }>Job ID</TableHeaderColumn>
<TableHeaderColumn dataField='status'>Job Status</TableHeaderColumn>
<TableHeaderColumn dataField='name' editable={ { type: 'textarea', readOnly: true } }>Job Name</TableHeaderColumn>
<TableHeaderColumn dataField='type' editable={ { type: 'select', readOnly: true, options: { values: jobTypes } } }>Job Type</TableHeaderColumn>
<TableHeaderColumn dataField='active' editable={ { type: 'checkbox', readOnly: true, options: { values: 'Y:N' } } }>Active</TableHeaderColumn>
</BootstrapTable>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment