I am trying to define where my file is to be saved to. I am starting out at the end user and moving inwards, so that means the start of the UI. I have the Label and the listbox but I am having troubles populating the listbox with the folders and sub folders that are in my Google Drive. The end product will be: Click the drop down menu -> chose folder to save file into -> click "submit" and it saves it into the folder.
Here is what i have so far: (Don't mind all my notes. I have zero JS experience and no programming experience so i am learning from the code that i already have from the original template maker. This is all of the code if you need it: http://pastebin.com/rbvu5Pie )
//look here for code about the listbox to show folders
grid.setWidget(2, 0, app.createLabel('Folder:')); //makes the label "folder" next to the listbox
var list = app.createListBox(); //defines what to do when i say list
grid.setWidget(2, 1, list); //puts the listbox to the right of the label
var folder = DocsList.getAllFolders()[0]; //defines that when i say "folder" it is supposed to get all folders
for (var i = 0; i < folder.length; i++) {
list.addItem(folder[i].getName(),folder[i].getId())
}
//this is the end of the code for the listbox showing folders
Thanks for your help everyone, i really appreciate it!
See Question&Answers more detail:os