Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery datatable and cakePHP
    primarykey
    data
    text
    <p>i am trying to implement <a href="http://www.datatables.net/index" rel="nofollow">jquery datatable</a>, 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.</p> <p>suppose i have this: my controller:</p> <pre><code>var $helpers = array( 'Form', 'Html', 'Javascript' ); //my method function dataTable_example($id=null){ $details = $this-&gt;Detail-&gt;find("all"); $this-&gt;set('details', $details ); } </code></pre> <p>my view:</p> <pre><code>&lt;div&gt; &lt;?php echo $javascript-&gt;link('libs/jquery.dataTables.js'); ?&gt; &lt;script&gt; $(document).ready(function(){ $('#js-datatable').dataTable(); }); &lt;/script&gt; &lt;h2&gt;&lt;?php echo __l('Tickets');?&gt;&lt;/h2&gt; &lt;div&gt; &lt;table id="js-datatable"&gt; &lt;tr&gt; &lt;th&gt;some heading 1&lt;/th&gt; &lt;th&gt;some heading 1&lt;/th&gt; &lt;th&gt;some heading 1&lt;/th&gt; &lt;/tr&gt; &lt;?php if (!empty($details)){ foreach ($details as $detail): ?&gt; &lt;tr&gt; &lt;td&gt;&lt;?php echo $detail['Detail']['id'];?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $detail['Detail']['created'];?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $detail['Detail']['ticket_detail'];?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php endforeach; }else{ ?&gt; &lt;tr&gt; &lt;td&gt;No Data Found&lt;/td&gt; &lt;/tr&gt; &lt;?php }?&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>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.</p> <p>did i missed some steps ? please help</p> <p>thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload