Commit 166db682c1dad8f2f14a623018bc2263a40bac22

Authored by Renato De Donato
1 parent 38197df0

converter 3 times :(

controllets/select-visualization-controllet/select-visualization-controllet.html
@@ -360,7 +360,14 @@ @@ -360,7 +360,14 @@
360 360
361 //use cache 361 //use cache
362 var data = alasql_complexSelectData(this.data, this.selectedFields, [], inputs.getAggregators(), inputs.getOrders()); 362 var data = alasql_complexSelectData(this.data, this.selectedFields, [], inputs.getAggregators(), inputs.getOrders());
  363 +
  364 + var converter = new DataTypeConverter();
  365 + var result = converter.inferJsonDataType(data, ["*"]);
  366 + result = converter.cast(result);
  367 + data = result.dataset;
  368 +
363 data = transformData(data, this.selectedFields, true); 369 data = transformData(data, this.selectedFields, true);
  370 +
364 this.params["data"] = JSON.stringify(data).replace(/'/g, "'"); 371 this.params["data"] = JSON.stringify(data).replace(/'/g, "'");
365 // 372 //
366 373
datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js
@@ -114,6 +114,7 @@ var AjaxJsonAlasqlBehavior = { @@ -114,6 +114,7 @@ var AjaxJsonAlasqlBehavior = {
114 //} 114 //}
115 115
116 var converter = new DataTypeConverter(); 116 var converter = new DataTypeConverter();
  117 +
117 var result = converter.inferJsonDataType(data, ["*"]); 118 var result = converter.inferJsonDataType(data, ["*"]);
118 result = converter.cast(result); 119 result = converter.cast(result);
119 data = result.dataset; 120 data = result.dataset;
@@ -126,6 +127,10 @@ var AjaxJsonAlasqlBehavior = { @@ -126,6 +127,10 @@ var AjaxJsonAlasqlBehavior = {
126 127
127 data = alasql_complexSelectData(data, fields, [], aggregators, orders); 128 data = alasql_complexSelectData(data, fields, [], aggregators, orders);
128 129
  130 + result = converter.inferJsonDataType(data, ["*"]);
  131 + result = converter.cast(result);
  132 + data = result.dataset;
  133 +
129 this.data = transformData(data, fields, true); 134 this.data = transformData(data, fields, true);
130 135
131 this._deleteWaitImage(); 136 this._deleteWaitImage();