1

I have question for Google App Maker.

I need a delete confirmation for every record on table. I already learn this url Dynamically Bind Data source to app maker popup, but It's not work with my case. What I did is :

a. On delete button, I set script :
widget.datasource.deleteItem(widget.parent.datasource);

b. On Confirmation button, I put script :
// GENERATED CODE: Add your action below.

if (typeof widget.root.properties.CallbackFn === 'function') {
widget.root.properties.CallbackFn();    
}
widget.root.visible = false;

app.closeDialog();

c. On Client Script, I put :

function deleteItem(datasource) {
var popup = app.popups.ConfirmationDialog;
var datasource2 = datasource;

popup.properties.CallbackFn = function() {
    datasource.deleteItem();
      };

popup.visible = true;
}

The result, I able to delete record, but no confirmation. Tell me know, what wrong with my script. @markus-malessa

MSFajari
  • 21
  • 3

1 Answers1

0

To show the deletion confirmation, I use a confirmation dialog popup. When I click "Yes", the application removes the current element from my data source with the code:

widget.datasource.deleteItem({success: successfullyDeleted()});

In "successfullyDeleted", I show a notification dialog that the item has been successfully deleted.