2013-11-01 33 views
0

我想写这个简单的用户界面应该显示一个消息与两个参数(名称,email2send)。但是,当我运行它,我得到的只有这个:谷歌应用脚​​本UI如何将消息插入VerticalPanel()?

enter image description here

变量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); 
    } 

感谢您的帮助!

回答

1

小部件的标记不可见,其目的实际上是以不可见的方式存储字符串数据。 要显示文本,请使用labelhtml小部件。

例如,在你的代码:

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); 
    } 
相关问题