Column for deleting records
Column for deleting records
I'm using datatables with server-side processing and jeditable. I reserved 1st column to associate each row with a register ID (I tried to use TR ID for that, but I wasn't able to). Now I would like to have a column where I can click to delete the record shown in the row.
Any sugestion? Remebering jeditable is keeping all columns editable.
Any sugestion? Remebering jeditable is keeping all columns editable.
This discussion has been closed.
Replies
Regards,
Allan
How jEditable acts on all columns, how can I have a column not handled by jEditable, so I can click on it when I whish to delete that row?
The problem is not to submit ID to the server, the problem is how to have an event to handle deleting action with jEditable working?
http://datatables.net/forums/comments.php?DiscussionID=591
http://datatables.net/forums/comments.php?DiscussionID=529
Allan
I need exactly the opposite, make all columns editable but one.
Things would be easier if datatables would have a way to receive columns and rows ID within aadata array.
var attr.Container = 'listagem';
var attr.EditColumns = [2,3,4];
var fnDrawCallback = function() {
for (var i in attr.EditColumns) {
jQuery('table.'+attr.Container+' tbody tr td:nth-child('+attr.EditColumns[i]+')').editable(attr.urlEdit, {
"callback": function(sValue,y) {
var aPos = oTable.fnGetPosition(this);
eval('var resp = '+sValue);
if (typeof(resp.column) != 'undefined') {
for (var i in resp.column)
oTable.fnUpdate(resp.column[i],aPos[0],i);
}
if (typeof(resp.alert) != 'undefined')
alert(resp.alert);
},
"submitdata": function (value,settings) {
var aPos = oTable.fnGetPosition(this);
var aData = oTable.fnGetData(aPos[0]);
return {"id":aData[0],"coluna":aPos[2]};
}
});
}
}