google apps script - How to mix jQuery and a UiInstance for generating GUIs -
i've got basic dialog form worked out using gui builder. put slider widget in form. (don't ask!)
the jquery ui lib has slider, seems in order jquery scripts , css loaded template, have switch html service instead of ui service page generation.
at moment have gui builder form working ok, running this;
function doget(e) { var app = uiapp.createapplication(); app.add(app.loadcomponent("doceditorgui")); return app; } and have jquery slider in html page can pull in this;
function doget(e) { return htmlservice.createhtmloutputfromfile('mysliderwidget'); } however using html file seems incompatible app.createhtml() html type widget, in nothing displayed if pass htmloutput contents. html processed, logger.log shows correct jquery , html.
var t = htmlservice.createhtmloutputfromfile('mysliderwidget'); var widgethtml = container.createhtml(t.getcontent()); widgethtml.setstyleattribute("background", "green"); logger.log( t.getcontent() ); vpanel.add(widgethtml ); however presumably getting caught caja also, because effect appears stripping out of id tags jquery. html added, broken jquery.
is there example use-case, or way trying things this?
as test-case, jquery slider example; http://pastebin.com/bny7phcl
runs in caja playground here; http://code.google.com/p/google-caja/wiki/cajaplayground
but not run under html widget above.
app.createhtml not use caja. strips out html except small subset. can see in docs here:
https://developers.google.com/apps-script/class_html
that strips out script tags.
htmlservice not app.createhtml widget; entirely new api , requires build entire app way. there's no way mix , match htmlservice's support jquery uiapp; it's 1 or other.
Comments
Post a Comment