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.
问题:
回答1:
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
回答2:
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>
回答3:
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:
No, in Google Apps Script you're limited to use the provided APIs. Specially when talking about Ui.