应用制造商:在网格中显示大查询数据 [英] App maker: Show Big Query data in grid
问题描述
我在Google应用制造商中拥有一个脚本:
I having an script in googles app maker:
function runQuery() {
var projectId = 'blalab155512';
var request = {
query: 'SELECT title FROM [bigquery-public-data:samples.wikipedia] where title contains "olimpic" LIMIT 100'
};
var queryResults = BigQuery.Jobs.query(request, projectId);
var jobId = queryResults.jobReference.jobId;
var names = queryResults.schema.fields.map(function(field){ return field.name; });
//var records = [];
return queryResults.rows.map(function(row) {
var record = app.models.Test.newRecord();
for (var i = 0, len = names.length; i < len; ++i) {
// Calculated model should contain correspondent fields
// all non-defined fields will be ignored
record[names[i]] = (row.f[i].v);
}
return record;
});
}
这从Big Query给了我所需的数据.记录仪输出的数据格式:
Which gives me the desired data from Big Query. Data format output from Logger:
我现在正努力将这些数据作为计算的数据源,然后将其显示为应用程序内的网格.
I'm now struggling with put that data as an Calculated Data Source and then show it as a grid within the app.
我有一个经过计算的数据源,该数据源调用上面的脚本来获取数据.然后,我配置了一个字段(字符串),在其中我想从查询中删除标题.
I have a calculated data source, which calls the script above to get the data. And I configured a field (String) in which I want to out the titles from the query.
在预览中未显示任何错误,但网格保持空白:
In preview no error was shown but the grid stay empty:
推荐答案
与表格"小部件不同,网格小部件不会为您生成所有嵌套的数据绑定小部件.您需要手动添加,布局和绑定所有显示窗口小部件:
Unlike Table widget, Grid widget will not generate all nested data-bound widgets for you. You need to manually add, layout and bind all display widgets:
这篇关于应用制造商:在网格中显示大查询数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!