Skip to content

Commit 2a45808

Browse files
committed
fix table drawing
1 parent 2814329 commit 2a45808

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ nosetests.xml
3333
.mr.developer.cfg
3434
.project
3535
.pydevproject
36+
.env
37+
.idea
38+
redis-2.6.12
39+
.DS_Store
40+
venv

gviz_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ def ToJSon(self, columns_order=None, order_by=()):
991991
{cols: [{id:"a",label:"a",type:"number"},
992992
{id:"b",label:"b",type:"string"},
993993
{id:"c",label:"c",type:"number"}],
994-
rows: [{c:[{v:1},{v:"z"},{v:2}]}, c:{[{v:3,f:"3$"},{v:"w"},{v:null}]}],
994+
rows: [{c:[{v:1},{v:"z"},{v:2}]}, c:{[{v:3,f:"3$"},{v:"w"},null]}],
995995
p: {'foo': 'bar'}}
996996
997997
Raises:

static/js/sql-editor.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,15 @@ jQuery(function () {
9696

9797
var typeMapper = {number: 'numeric', string: 'string', date: 'date'};
9898
var aoColumns = [];
99-
for (var i=0;i<data.H.length;i++) {
100-
var col = data.H[i];
99+
for (var i=0;i<data.cols.length;i++) {
100+
var col = data.cols[i];
101101
aoColumns.push({sTitle: col.label || col.id, sType: typeMapper[col.type] || 'string'});
102102
}
103103

104104
var aaData = [];
105-
var rows = data.K || data.J;
106105
if (rows) {
107-
for (var i=0;i<rows.length;i++) {
108-
var row = $.map(rows[i].c, function(val) {
106+
for (var i=0;i<data.rows.length;i++) {
107+
var row = $.map(data.rows[i].c, function(val) {
109108
return val ? val.v : '';
110109
});
111110

@@ -248,9 +247,10 @@ jQuery(function () {
248247
});
249248

250249
if (data) {
250+
drawTable(data);
251+
251252
var json_data = new google.visualization.DataTable(data, 0.6);
252253

253-
drawTable(json_data);
254254
drawPieChart(json_data);
255255
drawAreaChart(json_data);
256256
drawBarCharts(json_data);

0 commit comments

Comments
 (0)