From 166db682c1dad8f2f14a623018bc2263a40bac22 Mon Sep 17 00:00:00 2001 From: renato Date: Fri, 17 Jun 2016 12:39:20 +0200 Subject: [PATCH] converter 3 times :( --- controllets/select-visualization-controllet/select-visualization-controllet.html | 7 +++++++ datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js | 5 +++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/controllets/select-visualization-controllet/select-visualization-controllet.html b/controllets/select-visualization-controllet/select-visualization-controllet.html index 14dc754..ac4cb64 100755 --- a/controllets/select-visualization-controllet/select-visualization-controllet.html +++ b/controllets/select-visualization-controllet/select-visualization-controllet.html @@ -360,7 +360,14 @@ //use cache var data = alasql_complexSelectData(this.data, this.selectedFields, [], inputs.getAggregators(), inputs.getOrders()); + + var converter = new DataTypeConverter(); + var result = converter.inferJsonDataType(data, ["*"]); + result = converter.cast(result); + data = result.dataset; + data = transformData(data, this.selectedFields, true); + this.params["data"] = JSON.stringify(data).replace(/'/g, "'"); // diff --git a/datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js b/datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js index 90969a2..3757c6f 100755 --- a/datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js +++ b/datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js @@ -114,6 +114,7 @@ var AjaxJsonAlasqlBehavior = { //} var converter = new DataTypeConverter(); + var result = converter.inferJsonDataType(data, ["*"]); result = converter.cast(result); data = result.dataset; @@ -126,6 +127,10 @@ var AjaxJsonAlasqlBehavior = { data = alasql_complexSelectData(data, fields, [], aggregators, orders); + result = converter.inferJsonDataType(data, ["*"]); + result = converter.cast(result); + data = result.dataset; + this.data = transformData(data, fields, true); this._deleteWaitImage(); -- libgit2 0.21.4