Google apps script 如何创建一个;“装载”;在谷歌表单中弹出?
我在两张工作表之间的双向设置中使用“importrange”函数来隐藏专有公式,这需要几秒钟才能将结果更新到当前工作表。我想做的是在输入单元格中显示用户信息时,弹出一个“加载时请等待…”框X秒。我看过一些弹出窗口的例子,但不知道当一个单元格被更新时怎么做。。。。有什么想法吗?这使用javascript定时器。它将显示一个无模式对话框5秒钟,然后消失。当然,你可以把任何你喜欢的动画放在那里。我包括了dispStatus函数,我几乎一直在使用它。这可能不是最好的方法。但它是有效的Google apps script 如何创建一个;“装载”;在谷歌表单中弹出?,google-apps-script,google-sheets,Google Apps Script,Google Sheets,我在两张工作表之间的双向设置中使用“importrange”函数来隐藏专有公式,这需要几秒钟才能将结果更新到当前工作表。我想做的是在输入单元格中显示用户信息时,弹出一个“加载时请等待…”框X秒。我看过一些弹出窗口的例子,但不知道当一个单元格被更新时怎么做。。。。有什么想法吗?这使用javascript定时器。它将显示一个无模式对话框5秒钟,然后消失。当然,你可以把任何你喜欢的动画放在那里。我包括了dispStatus函数,我几乎一直在使用它。这可能不是最好的方法。但它是有效的 function
function timer_test()
{
dispStatus('Loading.....','<script>var myVar = setInterval(myTimer ,5000);function myTimer() { google.script.host.close();}</script>',200,200)
}
function dispStatus(title,html,width,height)
{
// Display a modeless dialog box with custom HtmlService content.
var title = typeof(title) !== 'undefined' ? title : 'No Title Provided';
var width = typeof(width) !== 'undefined' ? width : 250;
var height = typeof(height) !== 'undefined' ? height : 300;
var html = typeof(html) !== 'undefined' ? html : '<p>No html provided.</p>';
var htmlOutput = HtmlService
.createHtmlOutput(html)
.setWidth(width)
.setHeight(height);
SpreadsheetApp.getUi().showModelessDialog(htmlOutput, title);
}
功能计时器\u测试()
{
dispStatus('Loading….','var myVar=setInterval(myTimer,5000);函数myTimer(){google.script.host.close();}',200200)
}
函数dispStatus(标题、html、宽度、高度)
{
//显示具有自定义HtmlService内容的无模式对话框。
var title=typeof(title)!=“未定义”?title:“未提供标题”;
变量宽度=类型(宽度)!=“未定义”?宽度:250;
变量高度=类型(高度)!=“未定义”?高度:300;
var html=typeof(html)!=“未定义”?html:“未提供html。”;
var htmlOutput=HtmlService
.createHtmlOutput(html)
.setWidth(宽度)
.设置高度(高度);
SpreadsheetApp.getUi().showModelessDialog(htmlOutput,标题);
}
这使用javascript计时器。它将显示一个无模式对话框5秒钟,然后消失。当然,你可以把任何你喜欢的动画放在那里。我包括了dispStatus函数,我几乎一直在使用它。这可能不是最好的方法。但它是有效的
function timer_test()
{
dispStatus('Loading.....','<script>var myVar = setInterval(myTimer ,5000);function myTimer() { google.script.host.close();}</script>',200,200)
}
function dispStatus(title,html,width,height)
{
// Display a modeless dialog box with custom HtmlService content.
var title = typeof(title) !== 'undefined' ? title : 'No Title Provided';
var width = typeof(width) !== 'undefined' ? width : 250;
var height = typeof(height) !== 'undefined' ? height : 300;
var html = typeof(html) !== 'undefined' ? html : '<p>No html provided.</p>';
var htmlOutput = HtmlService
.createHtmlOutput(html)
.setWidth(width)
.setHeight(height);
SpreadsheetApp.getUi().showModelessDialog(htmlOutput, title);
}
功能计时器\u测试()
{
dispStatus('Loading….','var myVar=setInterval(myTimer,5000);函数myTimer(){google.script.host.close();}',200200)
}
函数dispStatus(标题、html、宽度、高度)
{
//显示具有自定义HtmlService内容的无模式对话框。
var title=typeof(title)!=“未定义”?title:“未提供标题”;
变量宽度=类型(宽度)!=“未定义”?宽度:250;
变量高度=类型(高度)!=“未定义”?高度:300;
var html=typeof(html)!=“未定义”?html:“未提供html。”;
var htmlOutput=HtmlService
.createHtmlOutput(html)
.setWidth(宽度)
.设置高度(高度);
SpreadsheetApp.getUi().showModelessDialog(htmlOutput,标题);
}
您也可以在电子表格中使用祝酒词:
您还可以在电子表格中使用祝酒词:
你们太棒了,谢谢!你们太棒了,谢谢!谢谢这个例子!!好主意。我忘了烤面包了。谢谢你的提醒。谢谢你的例子!!好主意。我忘了烤面包了。谢谢提醒。