This is the screen of my app, I click a row (it would highlight yellow) and the pressed delete
After I pressed delete, the yellow cleared off and nothing seems to happen
However, the record actually gets deleted in the google sheet
I am expecting the Web1 get block would refresh the table in my app screen after the delete is completed but it appeared it could not do that.
I have an update button which pretty much do the same thing and that seems to work fine. I think it may be the sequence of events or something but can't figure out.
Any help would be greatly appreciated, thanks a lot !
You can edit your delete function in the script to return all the records after the delete, something like this:
//DELETE SINGLE RECORD
else if (e.parameter.func == "Delete") {
var record = e.parameter.id;
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[0];
sh.deleteRow(parseInt(record) +1);
var rg = sh.getDataRange().getValues();
var outString = '';
for(var row=0 ; row<rg.length ; ++row){
outString += rg[row].join(',') + '\n';
}
return ContentService.createTextOutput(outString).setMimeType(ContentService.MimeType.TEXT);
}