是否有人可以告訴我如何使最後一項添加到可伸縮直接在現有項目的下方?如何將最後一個項目添加到前一個項目正下方的可靈活返回?
function doGet() {
var app = UiApp.createApplication();
var listBox = app.createListBox();
listBox.addItem("item 1").addItem("item 2").addItem("item 3").setName("myListBox");
var handler = app.createServerHandler("buttonHandler");
// pass the listbox into the handler function as a parameter
handler.addCallbackElement(listBox);
var table = app.createFlexTable().setId("myTable");
var button = app.createButton("+", handler);
app.add(listBox);
app.add(button);
app.add(table);
return app;
}
function buttonHandler(e) {
var app = UiApp.getActiveApplication();
app.getElementById("myTable").insertRow(0).insertCell(0, 0).setText(0, 0, e.parameter.myListBox);
return app;
}
這工作完美。再次感謝Serge。 – user1833055
您好Serge.I不得不編輯您以前的代碼。它基本上與您的代碼相同,但在flextable中添加了一個標頭。它一直說我無法將該代碼作爲新問題提交。它說,我需要「解釋」更多的代碼,因爲它與之前創建的代碼基本相同,我解釋了添加的額外代碼,所以這些代碼沒有意義。我想知道如何將項目添加到標題下的Flexbox我知道這不是提交問題的標準方式,但我沒有選擇。請幫助我理解爲什麼我得到這個錯誤以及 – user1833055