小编Gen*_*mes的帖子

onSelectionChange Google App Script 根本不起作用

我正在尝试根据当前选定的单元格更新 Google 表格中侧边栏的内容。我的第一个虚拟脚本是:

function onSelectionChange(e) {
  var ui = SpreadsheetApp.getUi();
  var range = e.range;
  var selectedRow = range.getNumRows();

  var htmlOutput = HtmlService
  .createHtmlOutput('This is row '+selectedRow)
  .setTitle('Title');
  ui.showSidebar(htmlOutput);
}
Run Code Online (Sandbox Code Playgroud)

...它什么都不做,即没有侧边栏显示。我试图停用应用程序脚本 v8,没有变化。

google-sheets google-apps-script

3
推荐指数
1
解决办法
990
查看次数

标签 统计

google-apps-script ×1

google-sheets ×1