Add an event if data

Add an event if data

j4vi3rj4vi3r Posts: 2Questions: 0Answers: 0
edited February 2012 in General
Hi, I really like dataTables and I would like to improve it for my system. at the moment I use the following code to show all the new pending orders every 60seconds. It works perfectly but I would like to add an event like alert() if there is some row in the table. ¿ How can I add this ?

[code]
$(document).ready(function() {
oTable2 = $(\'#example\').dataTable( {
"aaSorting": [[ 0, "desc" ]],
iDisplayLength: 10,
"bProcessing": true,
"bStateSave": true,
"bServerSide": true,
"sAjaxSource": "./scripts/request.php"
} );
setInterval(function(){
oTable2.fnReloadAjax();
},60000);
} );
[/code]

Thanks

Replies

  • jinjungjinjung Posts: 24Questions: 0Answers: 0
    Hi, There is a lot of solution I think.

    I'm just testing thiis and working well :

    "fnInfoCallback": function( oSettings, iTotal ) {
    if (iTotal) alert (iTotal);
    },
  • j4vi3rj4vi3r Posts: 2Questions: 0Answers: 0
    It worked perfectly, many thanks
This discussion has been closed.