Click event not working with AJAX
Click event not working with AJAX
Hello, I searched the forum and tried the advice did not work for me. I am trying to use the select multiple rows functionality in my data table. I have tried the following with no prevail.
[code]
var mytable;
$(document).ready(function() {
mytable = $('#eData').dataTable( {
"bProcessing": false,
"bJQueryUI": false,
"bPaginate": false,
"sAjaxSource": 'source.txt',
"iDisplayLength": -1,
"aoColumns":[
/*Paired*/ null,
/*Price */ { "bVisible": false },
/*Percentage*/ { "bVisible": false },
/*Previous*/ { "bVisible": false },
/*Status*/ { "bVisible": false }],
//"sDom": 'lfr<"fixed_height"t>ip'
} );
$ (mytable.fnGetNodes()).click ( function() { alert("TEST");});
} );
[/code]
[code]
var mytable;
$(document).ready(function() {
mytable = $('#eData').dataTable( {
"bProcessing": false,
"bJQueryUI": false,
"bPaginate": false,
"sAjaxSource": 'source.txt',
"iDisplayLength": -1,
"aoColumns":[
/*Paired*/ null,
/*Price */ { "bVisible": false },
/*Percentage*/ { "bVisible": false },
/*Previous*/ { "bVisible": false },
/*Status*/ { "bVisible": false }],
//"sDom": 'lfr<"fixed_height"t>ip'
} );
$ (mytable.fnGetNodes()).click ( function() { alert("TEST");});
} );
[/code]
This discussion has been closed.
Replies
[code]
$ ('#eData tr').live ('click', function() {
if ( $(this).hasClass('row_selected') )
$(this).removeClass('row_selected');
else
$(this).addClass('row_selected');
[/code]