jQuery UI with Google Apps script

2019-04-11 10:45发布

Is it possible to use a jQuery UI widget with a google apps script application? I have a textbox and I would like to use a date picker on it.

4条回答
兄弟一词,经得起流年.
2楼-- · 2019-04-11 10:53

Google Apps Script has built in DateBox and DatePicker classes in the UiApp Service. They are not yet in the documentation but if you type the reference to a UI instance into the Script Editor and add the trailing period, there are create methods for both. Google says they are working on adding the documentation. See here

查看更多
男人必须洒脱
3楼-- · 2019-04-11 10:54

You must watch the new services of google apps script:

Google I/O 2012 - Use What You Know: HTML and JavaScript in Apps Script

查看更多
姐就是有狂的资本
4楼-- · 2019-04-11 10:56

No, in Google Apps Script you're limited to use the provided APIs. Specially when talking about Ui.

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2019-04-11 11:10

Yes you can use JQueryUI with Google Apps Script. I suggest you look at example code, there's nothing special you need to do to make them work. Just make sure to develop your application using HtmlService and not UiService, you can't mix and match. Here's an example I lifted straight from them:

Code.gs

function doGet() {
  return HtmlService.createHtmlOutputFromFile('test.html');
}

test.html

<html>
  <head>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
  </head>
  <body>
    <div>Choose date:<input type="text" name="date" id="datepicker" /></div>
    <script>
      $("#datepicker").datepicker();
    </script>
  </body>
</html>
查看更多
登录 后发表回答