特定のスプレッドシートにデータを書き込むいくつかのフォーム要素を作成するUiAppがあります。ここで、UiAppウィジェットをhtmlServiceテンプレートにロードしたいのですが、これを実行する方法がわかりません。
私のdoGet関数は基本テンプレートをロードし、doGetAppはUiAppをビルドします。
function doGet() {
return HtmlService.createTemplateFromFile('base_template').evaluate();
}
function doGetApp() {
// creates input forms for a spreadsheet (the following is just an example
var app = UiApp.createApplication();
var tabPanel = app.createDecoratedTabPanel();
var flowPanel1 = app.createFlowPanel();
var flowPanel2 = app.createFlowPanel();
tabPanel.add(flowPanel1, "Create New Projects");
tabPanel.add(flowPanel2, "Edit Projects");
app.add(tabPanel);
// return app; // <<<< original doGet function returned the app
// testing different ways of returning the UiApp
return HtmlService.createHtmlOutput(app); // this displays the text "HtmlOutput"
}
私のbase_htmlテンプレートは今とてもシンプルです:
<html >
<?!= getCSS("css_js"); ?>
<body>
<h1>Template Test</h1>
<?!= doGetApp(); ?>
</body>
</html>
これについていくつかのバリエーションを試しましたが、結果は一般的に同じです。UiAppを表示するのではなく、オブジェクトを説明しているように見えるテキスト出力です。(getCSS関数は正常に機能します)
目標は、フォーム/結果のコンテンツを簡単にスタイル設定するために、自分のcss/jsとUiAppを簡単にロードできるようにすることです。私はこれにかなり慣れていないので、これに間違った方法でアプローチしている可能性があります。ポインタに感謝します。ありがとう!
-greg