如何使用谷歌應用程序腳本在谷歌網站重新加載頁面?我有一個函數創建一個表單,另一個函數doPost收集表單中提供的數據並將其寫入電子表格。電子表格嵌入在同一頁面中,我希望重新加載頁面以更新電子表格中的視圖。重新加載頁面谷歌應用程序腳本
我試圖在Site Services和Ui服務中找到一些功能或服務。
這裏的代碼
function doGet(e) {
var appRegistro = UiApp.createApplication().setTitle('Registre seu Atendimento!').setHeight(500);
var form = appRegistro.createFormPanel();
var flow = appRegistro.createFlowPanel();
var date=new Date();
//Construção do Menu
flow.add(appRegistro.createLabel("Data"));
flow.add(appRegistro.createTextBox().setName("Data").setValue(date).setReadOnly(true).setText(Utilities.formatDate(date, "GMT -02:00", "dd/MM/yyyy HH:mm:ss")));
flow.add(appRegistro.createLabel("Ticket ID"));
flow.add(appRegistro.createTextBox().setName("TicketID"));
flow.add(appRegistro.createLabel("Ticket Type"));
flow.add(appRegistro.createListBox().setName("TicketType").addItem("TicketType1").addItem("ticketType2").addItem("TicketType3").addItem("TicketType4"));
flow.add(appRegistro.createLabel("Demandado por"));
flow.add(appRegistro.createListBox().setName("DemandedBy").addItem("DemandedBy1").addItem("DemandedBy1"));
flow.add(appRegistro.createLabel("Nome do Analista"));
flow.add(appRegistro.createListBox().setName("Analyst").addItem("Analyst1").addItem("Analyst1").addItem("Analyst1"));
flow.add(appRegistro.createLabel("Status"));
flow.add(appRegistro.createListBox().setName("Status").addItem("Resolvido").addItem("Em Tratamento"));
flow.add(appRegistro.createLabel("Descrição"));
flow.add(appRegistro.createTextArea().setName("Description").setSize(400, 100));
flow.add(appRegistro.createSubmitButton("Salvar"));
form.add(flow);
appRegistro.add(form);
return appRegistro;
}
function doPost(e) {
var app=UiApp.createApplication();
var ss = SpreadsheetApp.openById("0AsXUq-Wd26qMdGFodkNqdERSc3NYaHhUQlRFeFNFQlE");
var DataValue = e.parameter.Data;
var TicketIDValue = e.parameter.TicketID;
var TicketTypeValue = e.parameter.TicketType;
var DemandedByValue = e.parameter.DemandedBy;
var AnalystValue = e.parameter.Analyst;
var StatusValue = e.parameter.Status;
var DescriptionValue = e.parameter.Description;
ss.getActiveSheet().appendRow([DataValue,TicketIDValue,TicketTypeValue,DemandedByValue,AnalystValue,StatusValue,DescriptionValue]).sort(1,false);
return app;
}