0

我正在尝试编写这个简单的 UI,它应该显示带有两个参数(名称、email2send)的消息。但是,当我运行它时,我只得到这个:

在此处输入图像描述

变量 msg 的内容不显示在面板中,仅显示面板标题。这样做的正确方法是什么?

// Show confirmation 
 function showMSG(name, email2Send) { // for ease of use I give the urls as parameters but you could define these urls in the function as well
  var app = UiApp.createApplication().setHeight(60).setWidth(200);
  app.setTitle("Msg send with sucess!");  
  var msg = "You request to " + email2Send + " a response from " + name;
  app.add(app.createVerticalPanel().setTag(msg));
  var doc = SpreadsheetApp.getActive();
  doc.show(app);
  }

提前感谢您的帮助!

4

1 回答 1

1

一个小部件的 TAG 是不可见的,它的目的实际上是以一种不可见的方式存储字符串数据。要显示文本,请使用标签html小部件。

您的代码中的示例:

function showMSG(name, email2Send) { // for ease of use I give the urls as parameters but you could define these urls in the function as well
  var app = UiApp.createApplication().setHeight(60).setWidth(200);
  app.setTitle("Msg send with sucess!");  
  var msg = "You request to " + email2Send + " a response from " + name;
  app.add(app.createVerticalPanel().add(app.createLabel(msg)));
  var doc = SpreadsheetApp.getActive();
  doc.show(app);
  }
于 2013-11-01T13:16:22.283 回答