jquery datatable and cakePHP

i am trying to implement jquery datatable, in my cakePHP based website, but it just wont load. this website is already half developed, and from the way i see it, the js' is loaded through a file called \[code\]_head.inc.ctp\[/code\] located inside the \[code\]views/layouts\[/code\] folder, i have added the datatables library inside the libs folder which is \[code\]webroot/js/libs\[/code\] and load it inside the \[code\]_head.inc.ctp\[/code\] file.suppose i have this:my controller:\[code\]var $helpers = array( 'Form', 'Html', 'Javascript');//my methodfunction dataTable_example($id=null){ $details = $this->Detail->find("all"); $this->set('details', $details );}\[/code\]my view:\[code\]<div> <?php echo $javascript->link('libs/jquery.dataTables.js'); ?><script> $(document).ready(function(){ $('#js-datatable').dataTable(); });</script> <h2><?php echo __l('Tickets');?></h2> <div> <table id="js-datatable"> <tr> <th>some heading 1</th> <th>some heading 1</th> <th>some heading 1</th> </tr> <?php if (!empty($details)){ foreach ($details as $detail): ?> <tr> <td><?php echo $detail['Detail']['id'];?></td> <td><?php echo $detail['Detail']['created'];?></td> <td><?php echo $detail['Detail']['ticket_detail'];?></td> </tr> <?php endforeach; }else{ ?> <tr> <td>No Data Found</td> </tr> <?php }?> </table> </div></div>\[/code\]i even hard coded it using the usual call, and checked it using firebug to see if the script is loaded or not, and according to firebug, it is loaded, so i cant see whats making the script fail my table.did i missed some steps ? please helpthanks
 
Top