diff --git a/package.json b/package.json index 0f32de3..50bb9f2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "LightPivotTable", "author": "ZitRo", - "version": "1.7.0", + "version": "1.7.1", "description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache", "main": "test/testServer.js", "repository": { diff --git a/source/js/DataController.js b/source/js/DataController.js index 1e1084f..1d3b9da 100644 --- a/source/js/DataController.js +++ b/source/js/DataController.js @@ -107,7 +107,7 @@ DataController.prototype.setData = function (data) { this.controller.pivotView.listingClickHandler.bind(this.controller.pivotView) ); } - //console.log(data); + // console.log(data); this._trigger(); return data; @@ -561,7 +561,7 @@ DataController.prototype.resetRawData = function () { rawData[y][x] = rd0[y][x-yw]; } else { rawData[y][x] = { - value: data.dataArray[(xw)*(y - xh) + x - yw] || "" + value: data.dataArray[(xw)*(y - xh) + x - yw] }; } } diff --git a/source/js/PivotView.js b/source/js/PivotView.js index 38a83d3..fe3ff61 100644 --- a/source/js/PivotView.js +++ b/source/js/PivotView.js @@ -624,14 +624,15 @@ PivotView.prototype.removeMessage = function () { }; /** - * @param {*} value1 + * @param {*} value * @param {string} operator * @param {*} value2 - fixed value * @private * @return {boolean} */ -PivotView.prototype._matchCondition = function (value1, operator, value2) { +PivotView.prototype._matchCondition = function (value, operator, value2) { + var value1 = parseFloat(value); switch (operator) { case "=": return value1 == value2; case "<>": return value1 != value2; @@ -1099,7 +1100,7 @@ PivotView.prototype.renderRawData = function (data) { var formatContent = function (value, element, format) { if (typeof(value) === 'string') { // not number, format as string - element.className += " formatLeft"; + element.parentNode.className += " formatLeft"; element.innerHTML = (value || "").replace(/(https?|ftp):\/\/[^\s]+/ig, function linkReplace (p) { return "<a href='" + p + "' target='" + (_.controller.CONFIG["linksTarget"] || "_blank") @@ -1113,13 +1114,13 @@ PivotView.prototype.renderRawData = function (data) { element.textContent = d.getHours() + d.getMinutes() + d.getSeconds() === 0 ? d.toLocaleDateString() : d.toLocaleString(); } else if (format) { // set format - element.textContent = value ? _.numeral(value).format(format) : ""; + element.textContent = value ? _.numeral(value).format(format) : value; } else if (value) { element.textContent = _.numeral(value).format( value % 1 === 0 ? "#,###" : "#,###.##" ); } else { - element.textContent = value || ""; + element.textContent = value; } } else { element.textContent = value;