Show info link using mrender not working ?

Show info link using mrender not working ?

GedeAnomGedeAnom Posts: 4Questions: 0Answers: 0
edited August 2013 in General
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]

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Please see the top FAQ: http://datatables.net/faqs#events

    Allan
  • GedeAnomGedeAnom Posts: 4Questions: 0Answers: 0
    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..
This discussion has been closed.