Hi,
Does anyone have any suggestions for adding a confirmation dialogue to a jgrid.action link?
I have a backend column that indicates if an invoice is paid or unpaid. Clicking on it uses jgrid.action to change the field value of the paid column. I am adding a feature to send an email notification to the end user when the status is changed.
I cannot seem to intercept the link click and confirm before the system JavaScript proceeds to submit the form.
I’ve tried
jQuery('a[data-item-task$=togglePaid]').on('click', function(e) {
e.stopPropagation();
e.preventDefault();
return confirm('Are you sure you want to change the paid status of this item?');
});
And basically the same without jQuery, but it does not stop the process. My current solution is to use the link and only use the batch process which has a confirmation already.
So, an ideas on how to add a confirmation to a jgrid link?