0

I'm working on a scala application with playframework, I want to use the popover confirm in a smart-table for the delete case, The question is how to execute the delete function which is declared in angular controller on the click on yes button of the popconfirm?

 <button type="button" data-toggle="tooltip" data-original-title="Remove" class="btn btn-danger popconfirm" btn-delete><i class="hi hi-remove"></i>
                        </button>

there is my jquery-popconfirm file : http://pastebin.com/SinHkqCi

Also I'm using this directive to call my popconfirm :

app.directive('popconfirm', function(){
return {
  restrict: 'C',
  link: function(scope, element){
    element.popConfirm();
  }
};
});
4
  • Did you try using ng-click="yourDeleteFunction()" in your button? Commented Mar 10, 2016 at 15:40
  • yes, but it's delete without confirmation Commented Mar 10, 2016 at 15:46
  • Hey, did my answer work for you? Then it would be great to mark it as correct or give it an upvote :) Do you still have problems with the popover? Commented Mar 14, 2016 at 14:10
  • Thank you for your help, I didn't work with your solution. I'm using only directive, but your solution sounds interesting. +1 vote Commented Mar 15, 2016 at 10:44

1 Answer 1

1

If you are using bootstrap's popconfirm, I found this example here:

http://jsfiddle.net/RDh7E/28/

Try something like this (from the mentioned example)

// (example jquery click event)
$('#important_action').click(function() {
    alert('You clicked, and valided this button !');
});

// Full featured example
$("[data-toggle='confirmation']").popConfirm({
    title: "Really ?",
    content: "I have warned you !",
    placement: "bottom"
});

html

<button class="btn btn-success popconfirm_full" data-toggle='confirmation' id="important_action">Full featured</button>

The important thing is, that the click event on the button calls the function that should be executed (probably also possible with angular's ng-click) and the popconfirm is handled via data-toggle='confirmation'. The example works but I haven't tried myself.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.