my onclick event not firing after grid sort.
grid columns markup
columns: [
{
field: "", title: "", width: "150px", attributes: { "class": "ps-0" }, template: function(dataItem) {
var actionHtmlContent = '';
if (dataItem && dataItem.canEdit) {
actionHtmlContent += '<a class="btn btn-link" href="' + contactDetailLink + '/1/' + dataItem.id + '">';
actionHtmlContent += '<em class="material-icons material-edit" style="color:#0D4EA2;"></em>';
actionHtmlContent += '</a>';
}
if (dataItem && dataItem.canDelete) {
actionHtmlContent += '<a class="btn btn-link delete-button" title=" " aria-label=" " href="?AppContactID=' + encodeURIComponent(dataItem.id) + ' &handler=Delete">';
actionHtmlContent += '<em class="material-icons material-delete" style="color:#0D4EA2;"></em>';
actionHtmlContent += '</a>';
}
return actionHtmlContent;
}
},
{ field: "salutation", title: "Salutation", width: "130px" },
{ field: "fullName", title: "Full Name", width: "200px" },
code to attach onclick
$(".delete-button").on("click", function () { return confirm('Are you sure you want to proceed?'); });
my js tag has nounce, thus i can't add the event listener to the html tag itself.
after i sort the grid, when user click on the .delete-button the confirm popup is not showing