I have a jqgrid I am using formatter for a column as
{ name: 'Delete', width: 40, formatter: self.deleteBtnFormatter }
where the deleteBtnFormatter is as follows :
deleteBtnFormatter: function (cellvalue, options, rowdata) {
var self = this;
if (cellVale== "Yasser") {
return "<div class='abc'>-</div>";
}
else {
var deleteBtnId = // i am getting this from rowData
var deleteButton = "<div class='xyz'" + "id='" + deleteBtnId + "' >Delete<div>";
return deleteButton;
}
},
Now my problem is how should I bind all these delete buttons to an another javascript method, from where I am going to make an ajax call to delete this entry.
Also I note that I want to pass parameters to the javascript method.
I know this can be done using Url.Action
or by playing around with href
property, but I want to bind it instead.
Thanks