Using a Google Site with an embedded Google Apps Script, I'm displaying some data from a database using JDBC. The Google Apps Script uses doGet
to load an HTML page:
function doGet() {
return HtmlService.createHtmlOutputFromFile('index');
}
...the index.html page in turn calls a function in my Apps Script to get some database data:
google.script.run.withSuccessHandler(mySuccessHandler).getSomeDBData();
When the mySuccesshandler
is called, I render the data with the JQuery.
This works. However, embedded Google Apps Scripts have a statically defined height. A post on SO suggested developing a custom Google Gadget which dynamically resizes when content changes.
But I can't find any examples, or confirmation that I can port my current Google Apps Script to my own Gadget. The documentation on working with remote content doesn't mention databases.
I tried placing the call to my App Script in the Gadget XML file:
google.script.run.withSuccessHandler(mySuccessHandler).getSomeDBData();
However, this failed with cannot call run of undefined
. So is there any way I can call a GAS from a custom Google Widget?