Commit 9fb4369ce9d77ce293ba3697c2a1fc1b626c2abd
1 parent
75918d56
my space on add preview bug fix
Showing
1 changed file
with
9 additions
and
5 deletions
datalets/base-ajax-json-alasql-datalet/static/js/AjaxJsonAlasqlBehavior.js
... | ... | @@ -85,23 +85,27 @@ var AjaxJsonAlasqlBehavior = { |
85 | 85 | selectData : function() { |
86 | 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 | 88 | this._component.fields = JSON.parse(this._component.fields); |
90 | 89 | |
91 | - var provider = this._getProvider(this._component.fields[0]); | |
92 | - | |
93 | 90 | var filters = JSON.parse(this._component.getAttribute("filters")); |
94 | 91 | var aggregators = JSON.parse(this._component.getAttribute("aggregators")); |
95 | 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 | 103 | var path = this._path(this._component.fields[0], provider); |
98 | 104 | |
99 | 105 | var fields = []; |
100 | 106 | for (var i=0; i < this._component.fields.length; i++) |
101 | 107 | fields.push(this._fieldName(this._component.fields[i], provider)); |
102 | 108 | |
103 | - | |
104 | - | |
105 | 109 | //WHERE |
106 | 110 | var where = ""; |
107 | 111 | if(filters && filters.length) { | ... | ... |