Links on each row not detected when clicked
Links on each row not detected when clicked
Hi all,
I use DataTables with serverside and try to create a delete link on each row, using mRender i put an image where when clicked I hope execute the delete process.
My code is:
[code]
$(document).ready(function() {
oTable=$("#listData").dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "form1-load-data.php",
"aoColumns" : [
{ "bVisible" : false},
{ "sClass" : "center"},
null,
{"sClass" : "left" },
{"sClass" : "alignright","bSortable":false,
"mRender": function ( data, type, full ) {
return "";
}
}
]
})
});
$("#listData td a.deleteRow").click(function(event) {
console.log('delete from a link ?');
/*
Ajax post where delete process on DB base on id and when success re-draw the table using fnDraw
*/
} );
$("#listData td img#deleteRow").click(function(event) {
console.log('delete from image ?');
/*
Ajax post where delete process on DB base on id and when success re-draw the table using fnDraw
*/
} );
[/code]
I am trying to make row delete is simple, but when the delete image is clicked, no log produced in console log. what is wrong ?
Trying to catch the image also, but not successfull..
Thanks in advance..
I use DataTables with serverside and try to create a delete link on each row, using mRender i put an image where when clicked I hope execute the delete process.
My code is:
[code]
$(document).ready(function() {
oTable=$("#listData").dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "form1-load-data.php",
"aoColumns" : [
{ "bVisible" : false},
{ "sClass" : "center"},
null,
{"sClass" : "left" },
{"sClass" : "alignright","bSortable":false,
"mRender": function ( data, type, full ) {
return "";
}
}
]
})
});
$("#listData td a.deleteRow").click(function(event) {
console.log('delete from a link ?');
/*
Ajax post where delete process on DB base on id and when success re-draw the table using fnDraw
*/
} );
$("#listData td img#deleteRow").click(function(event) {
console.log('delete from image ?');
/*
Ajax post where delete process on DB base on id and when success re-draw the table using fnDraw
*/
} );
[/code]
I am trying to make row delete is simple, but when the delete image is clicked, no log produced in console log. what is wrong ?
Trying to catch the image also, but not successfull..
Thanks in advance..
This discussion has been closed.