Commit 9fb4369ce9d77ce293ba3697c2a1fc1b626c2abd

Authored by Renato De Donato
1 parent 75918d56

my space on add preview bug fix

datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js
@@ -85,23 +85,27 @@ var AjaxJsonAlasqlBehavior = { @@ -85,23 +85,27 @@ var AjaxJsonAlasqlBehavior = {
85 selectData : function() { 85 selectData : function() {
86 var jsonData = [this.properties.json_results.value]; 86 var jsonData = [this.properties.json_results.value];
87 87
88 - //his._component.fields = (this._component.fields.constructor == Array) ? this._component.fields : JSON.parse(this._component.fields);  
89 this._component.fields = JSON.parse(this._component.fields); 88 this._component.fields = JSON.parse(this._component.fields);
90 89
91 - var provider = this._getProvider(this._component.fields[0]);  
92 -  
93 var filters = JSON.parse(this._component.getAttribute("filters")); 90 var filters = JSON.parse(this._component.getAttribute("filters"));
94 var aggregators = JSON.parse(this._component.getAttribute("aggregators")); 91 var aggregators = JSON.parse(this._component.getAttribute("aggregators"));
95 var orders = JSON.parse(this._component.getAttribute("orders")); 92 var orders = JSON.parse(this._component.getAttribute("orders"));
96 93
  94 + //preview my space
  95 + if(filters[0] && filters[0].constructor == Array){
  96 + filters = filters[0];
  97 + aggregators = aggregators[0];
  98 + orders = orders[0];
  99 + }
  100 +
  101 + var provider = this._getProvider(this._component.fields[0]);
  102 +
97 var path = this._path(this._component.fields[0], provider); 103 var path = this._path(this._component.fields[0], provider);
98 104
99 var fields = []; 105 var fields = [];
100 for (var i=0; i < this._component.fields.length; i++) 106 for (var i=0; i < this._component.fields.length; i++)
101 fields.push(this._fieldName(this._component.fields[i], provider)); 107 fields.push(this._fieldName(this._component.fields[i], provider));
102 108
103 -  
104 -  
105 //WHERE 109 //WHERE
106 var where = ""; 110 var where = "";
107 if(filters && filters.length) { 111 if(filters && filters.length) {