Google Apps Script で UiApp をラッピング機能で拡張 (プロトタイプ) したいのですが、以下のような単純なサンプルを実行すると TypeError が発生します... 何が間違っていますか?
Object.prototype.addLabel = function(text) {
this.createLabel(text);
return this;
}
function testingxUiApp() {
var doc = SpreadsheetApp.getActiveSpreadsheet();
var app = UiApp.createApplication().setTitle('playing around UiApp').setHeight("250");
var panel = app.createFlowPanel().setId('panel');
app.add(panel);
panel.add(app.addLabel("adding label for testing"));
doc.show(app);
}
ありがとう