diff --git a/lib/index.js b/lib/index.js index 3431750..64ff0b4 100644 --- a/lib/index.js +++ b/lib/index.js @@ -324,7 +324,7 @@ var ReactDatatable = function (_Component) { var cellData = _server2.default.renderToStaticMarkup(_column.cell(record, i)); cellData = this.strip(cellData); tableHtml += "" + cellData + ""; - } else if (record[_column.key]) { + } else if (record[_column.key] !== undefined) { tableHtml += "" + record[_column.key] + ""; } else { tableHtml += ""; @@ -480,7 +480,7 @@ var ReactDatatable = function (_Component) { var cellData = _server2.default.renderToStaticMarkup(_column2.cell(record, i)); cellData = this.strip(cellData); newRecord[_column2.key] = cellData; - } else if (record[_column2.key]) { + } else if (record[_column2.key] !== undefined) { var colValue = record[_column2.key]; colValue = typeof colValue === "string" ? colValue.replace(/"/g, '""') : colValue; newRecord[_column2.key] = '"' + colValue + '"'; diff --git a/src/index.js b/src/index.js index 2af5039..4beb585 100644 --- a/src/index.js +++ b/src/index.js @@ -229,7 +229,7 @@ class ReactDatatable extends Component { let cellData = ReactDOMServer.renderToStaticMarkup(column.cell(record, i)); cellData = this.strip(cellData); tableHtml += "" + cellData + ""; - }else if (record[column.key]) { + }else if (record[column.key]!==undefined) { tableHtml += "" + record[column.key] + ""; } else { tableHtml += ""; @@ -336,7 +336,7 @@ class ReactDatatable extends Component { let cellData = ReactDOMServer.renderToStaticMarkup(column.cell(record, i)); cellData = this.strip(cellData); newRecord[column.key] = cellData; - } else if (record[column.key]) { + } else if (record[column.key]!==undefined) { let colValue = record[column.key]; colValue = (typeof colValue === "string") ? colValue.replace(/"/g, '""') : colValue; newRecord[column.key] = '"' + colValue + '"';