1 回答

TA贡献1851条经验 获得超5个赞
我认为您的问题的原因可能是google.script.run没有返回任何值。那么在你的脚本中,下面的修改怎么样?
修改脚本:
在这种情况下,请criarTabela在 Javascript 端进行修改。
function criarTabela(conteudo) {
var tabela = document.createElement("table");
var thead = document.createElement("thead");
var tbody=document.createElement("tbody");
var thd=function(i){return (i==0)?"th":"td";};
for (var i=0;i<conteudo.length;i++) {
var tr = document.createElement("tr");
for(var o=0;o<conteudo[i].length;o++){
var t = document.createElement(thd(i));
var texto=document.createTextNode(conteudo[i][o]);
t.appendChild(texto);
tr.appendChild(t);
}
(i==0)?thead.appendChild(tr):tbody.appendChild(tr);
}
tabela.appendChild(thead);
tabela.appendChild(tbody);
document.getElementById("tabela").appendChild(tabela); // Added
}
google.script.run.withSuccessHandler(criarTabela).Lista_Aguard_Ajuste(); // Modified
笔记:
在此修改中,它假定Lista_Aguard_Ajuste()在您的 Google Apps 脚本中有效。请注意这一点。
添加回答
举报