Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenberger committed Feb 16, 2016
2 parents 90e6c36 + 38a8bd9 commit 2821436
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
18 changes: 4 additions & 14 deletions examples/js/column-format/extra-data-column-format-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ var qualityType = {
0: "good",
1: "bad",
2: "unknown"
}
};
var inStockStatus = {
1: "yes",
2: "no"
}
};

function addProducts(quantity) {
var startId = products.length;
Expand All @@ -34,25 +34,15 @@ function enumFormatter(cell, row, enumObject){
return enumObject[cell];
}

var cellEditProp = {
mode: "click",
blurToSave: true
};

export default class ExtraDataColumnFormatTable extends React.Component{
render(){
var optionValues = [];
$.map(inStockStatus, function(value, index) {
optionValues.push(index);
});

return (
<BootstrapTable data={products} cellEdit={cellEditProp} insertRow={true}>
<BootstrapTable data={products} >
<TableHeaderColumn dataField="id" isKey={true}>Product ID</TableHeaderColumn>
<TableHeaderColumn dataField="name">Product Name</TableHeaderColumn>
<TableHeaderColumn dataField="quality" dataFormat={enumFormatter} formatExtraData={qualityType}>Product Quality</TableHeaderColumn>
<TableHeaderColumn dataField="inStock" dataFormat={enumFormatter} formatExtraData={inStockStatus}>Product Stock Status</TableHeaderColumn>
</BootstrapTable>
);
}
};
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-bootstrap-table",
"version": "1.5.0",
"description": "It' a react table for bootstrap",
"description": "It's a react table for bootstrap",
"main": "./dist/react-bootstrap-table.min.js",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BootstrapTable extends React.Component {

if (keyField == null)
throw "Error. No any key column defined in TableHeaderColumn."+
"Use 'isKey={true}' to specify an unique column after version 0.5.4.";
"Use 'isKey={true}' to specify a unique column after version 0.5.4.";

this.store.setProps({
isPagination: props.pagination,
Expand Down
2 changes: 1 addition & 1 deletion src/TableColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TableColumn extends React.Component{
return shouldUpdated;
}

if(typeof children === 'object') {
if(typeof children === 'object' && children !== null) {
if(children.props.type === 'checkbox' || children.props.type === 'radio') {
shouldUpdated = shouldUpdated ||
children.props.type !== nextProps.children.props.type ||
Expand Down

0 comments on commit 2821436

Please sign in to comment.