Thanks Dimiter Madjarov. It works. Now below is the issue I am facing. I am trying to replace the destroy Delete text with the Delete Image.
Issue 1: When I click on the Delete icon is not firing the editable confirmation function but if I remove the template column the editable confirmation function is working.
Issue 2: After replacing the image the above databound function which you have mentioned is not working. I assume that this is because of the template column. Any idea of how to resolve this or is there any other way to implement this?
Sample Code:
command: [{ name: "destroy", template: "<img src='../Images/delete.png' title='Delete' style='cursor: pointer;height:13px;width:13px;'/>"}], title: " ", width: 70
Editable Confirmation Function:
editable: {
confirmation: function (e) {
if (e.DeleteAction == 'y')
return "Are you sure that you want to delete record for " + e.Name + "?";
}
}
Databound event:
var grid = this;
grid.tbody.find("tr[role='row']").each(function (e) {
var model = grid.dataItem(this);
if (model.DeleteAction != 'y') {
$(this).find(".k-grid-delete").remove();
}
});
Appreciate your help on this.
Thanks,
Edwin