Example code for deleteConfirmation of RESTful AUI Table

Holger Schimanski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2018

I am using RESTful table from AUI and what to configure deleteConfiguration message which is shown, when user clicks on Delete for a row.

In the documentation it says deleteConfirmation is boolean, but learned from here, that actually a function needs to be set for deleteConfirmation e.g.

deleteConfirmation : function () { return "Are you sure?"; }

When adding a <input type="submit" value"OK"/> I can also add an OK button, but how to add a Cancel button?

Does anyone has some example code?

 

 

1 answer

1 accepted

0 votes
Answer accepted
Holger Schimanski
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 5, 2018

Reviewing aui-experimental.js it looks like RESTful table is looking for a form.submit element and attaches the corresponding OK action to it.

a.element.find("form").submit(_.bind(function(b){...

And it is looking for an element with CSS class cancel and attaches the corresponding HIDE action to it.

a.element.find(".cancel").click(function(){a.hide()});

That means the HTML should look like this.

deleteConfirmation: function(){
       return 'Are you sure? <form><button class="aui-button aui-button-primary">Okay</button></form>' +
         '<button class="aui-button aui-button-link cancel">Cancel</button>';
}

 

Suggest an answer

Log in or Sign up to answer