Google 日历插件:如何实现 "select all" 复选框?

Google Calendar add-on: how to implement a "select all" checkbox?

我是一名新程序员,正在开发 Google 日历插件,其 UI 是使用 CardService 编写的。这是其复选框小部件的代码。

var calendar = CardService.newSelectionInput()
  .setType(CardService.SelectionInputType.CHECK_BOX)
  .setFieldName("calendar")
  .addItem("select all", "all", false)
  .addItem("calendar1", "cal1", false)
  .addItem("calendar2", "cal2", false)

当我选中“select all”复选框时,我希望所有复选框都被选中,而当我取消选中它时,其他任何复选框也都被取消选中。我怎样才能做到?

此外,我可以用 html 制作 Google 日历插件 UI 吗?因为在 html 中这样做似乎更容易。就我而言,工作区附加组件既不能使用 HTML 也不能使用 HTMLService 来构建 UI,但是 this exsample 在其 Settings.gs doGet 函数中的文件。这让我很困惑,我是不是漏掉了什么?

提前致谢。

我已经使用 setOnChangeAction() 和 CardService.newNavigation().updateCard() 解决了这个问题。类似 this.

事实证明,Google Workspace 附加组件不能使用 HTML 或 CSS。 Restrictions