【发布时间】:2017-11-15 00:38:15
【问题描述】:
我有一个有两行的表:第一行是标题,第二行是这样的......
<tr>
<td><b>1</b></td>
<td><input type="date" id="dt" name="dt"></td>
<td><input type="time" id="tmStart" name="tmStart"></td>
<td><input type="time" id="tmEnd" name="tmEnd"></td>
<td><select id="ddlTrainType" name="ddlTrainType"><option>Select Training</option></select></td>
<td><input type="text" id="txtLoc" name="txtLoc"></td>
<td><select id="ddlProg" name="ddlProg"><option>Select Program</option></select></td>
<td><select id="ddlTrainMod" name="ddlTrainMod"><option>Select Module</option></select></td>
<td><select id="ddlTrainName" name="ddlTrainName"><option>Select Trainer</option></select></td>
<td><select id="ddlStat" name="ddlStat"><option>Pending</option><option>Completed</option><option>Cancelled</option></select></td>
</tr>
注意:所有选择标签下拉菜单都是从另一个谷歌电子表格填充的。
现在,在单击按钮时(像 add row 之类的按钮),我想在此表中添加与上面类似的行。
不仅添加一行,最后,假设总共有5行,点击提交,那么我想将所有5行存储在Google电子表格中。
任何想法如何做到这一点?
我已经尝试在 code.gs 文件的帮助下添加行并使用 HtmlService.createTemplate 重构模板。但这只能在doGet(e)中使用,我猜不能与js按钮动作一起使用。
假设我们创建了这样一个动态表,但即使在这之后,我们如何将所有表数据从 javascript 传递到 code.gs 文件?
【问题讨论】:
标签: javascript jquery html google-apps-script