Show info link using mrender not working ?
Show info link using mrender not working ?
Hi,
I have table with the setting below.
I am trying to put an image as "show info" for each row, and when clicked, I want an alert box showing a text : "Sort info" (just that for now).
The problem is when image link (with id="showinfo") is clicked, nothing happen (no alert).
(I only put 1 row, and still no alert too).
What is wrong?
[code]
var oTable;
$(document).ready(function() {
$('#listData td img#showinfo').click( function(event) {
event.preventDefault();
event.stopPropagation();
alert('Sort info');
});
oTable=$("#listData").dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "sampledata.js",
"aoColumns" : [
{ "bVisible" : false},
{ "sClass" : "center"},
null,
{"sClass" : "left" },
{"sClass" : "alignright","bSortable":false,
"mRender": function ( data, type, full ) {
return '';
}
},
null
]
})
});
[/code]
I have table with the setting below.
I am trying to put an image as "show info" for each row, and when clicked, I want an alert box showing a text : "Sort info" (just that for now).
The problem is when image link (with id="showinfo") is clicked, nothing happen (no alert).
(I only put 1 row, and still no alert too).
What is wrong?
[code]
var oTable;
$(document).ready(function() {
$('#listData td img#showinfo').click( function(event) {
event.preventDefault();
event.stopPropagation();
alert('Sort info');
});
oTable=$("#listData").dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "sampledata.js",
"aoColumns" : [
{ "bVisible" : false},
{ "sClass" : "center"},
null,
{"sClass" : "left" },
{"sClass" : "alignright","bSortable":false,
"mRender": function ( data, type, full ) {
return '';
}
},
null
]
})
});
[/code]
This discussion has been closed.
Replies
Allan
Thank you very much, solve the problem.
I have been search everywhere.
Working now with using on() event :
[code]
$('#listData').on('click','img#delimg2', function(event) {
event.preventDefault();
event.stopPropagation();
alert('Sort info');
});
[/code]
thanks again Allan..