Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Tabletools not working as expected
    primarykey
    data
    text
    <p>I am using the jQuery DataTables library to style the tables on my website which is running Joomla 2.5. <a href="http://datatables.net/" rel="nofollow noreferrer">http://datatables.net/</a></p> <p>The problem I am having is its not working, but it also isn't giving any sort of error in firebug either, so I have no trail to follow or anything.</p> <p>The HTML / PHP of my table goes like this:</p> <pre><code>&lt;table class="staff_table"&gt; &lt;h3&gt;Members of Staff&lt;/h3&gt; &lt;p&gt;If you're looking for a member of staff at Tower Road Academy, you'll find their details here.&lt;/p&gt; &lt;tr class="staff_table_head"&gt; &lt;td&gt;Name&lt;/td&gt; &lt;td&gt;Job Title&lt;/td&gt; &lt;td&gt;Email Address&lt;/td&gt; &lt;/tr&gt; &lt;?php $result = mysql_query("SELECT * FROM itsnb_chronoforms_data_addstaffmember"); while($row = mysql_fetch_array($result)) { echo '&lt;tr&gt;'; echo '&lt;td&gt;' . $row['staff_name'] . '&lt;/td&gt;&lt;td&gt;' . $row['staff_job'] . '&lt;/td&gt;&lt;td&gt;&lt;a href=mailto:"' . $row['staff_email'] . '"&gt;' . $row['staff_email'] . '&lt;/a&gt;' . '&lt;/td&gt;'; echo '&lt;/tr&gt;'; } ?&gt; &lt;/table&gt; </code></pre> <p>I am loading jQuery and the DataTables library and initializing it like this in the index.php of the template file :</p> <pre><code>&lt;script src="./datatables/js/jquery.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="./datatables/js/jquery.dataTables.js" type="text/javascript"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#staff_table').dataTable(); } ); &lt;/script&gt; </code></pre> <p>The above should give me something along the lines of the following: <img src="https://i.stack.imgur.com/XheOv.jpg" alt="Example DataTables Styled Table"></p> <p>jQuery is certainly working, as if I use the following it pops a box up as expected:</p> <pre><code>$(document).ready(function() { alert('hi'); }); </code></pre> <p>I have even tried jQuery No Conflict, by adding <code>jQuery.noConflict();</code> before I call the function and still nothing, no errors, no working.</p> <hr> <h2>EDIT</h2> <p>If I change to the following I then get the following error:</p> <pre><code>&lt;script src="./datatables/js/jquery.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="./datatables/js/jquery.dataTables.js" type="text/javascript"&gt; &lt;/script&gt; &lt;script type="text/javascript"&gt; jQuery.noConflict(); jQuery(document).ready(function() { jQuery('.staff_table').dataTable(); } ); &lt;/script&gt; </code></pre> <p>This is the error I get in Firebug:</p> <pre><code>TypeError: oColumn is undefined initialize(b=Object { tweakInitial={...}, tweakSubsequent={...}, tweakSizes={...}, more...}, a=Object { options={...}, element=ul.menutop, rtl=false, more...}, c=span#span- 1346841479204301.daddy)fusion.js (line 8) initialize()mootools-more.js (line 27) b()mootools-core.js (line 140) g()mootools-core.js (line 135) initialize(o=span#span-1346841479204301.daddy, m=1)fusion.js (line 8) forEach(i=function(), v=Object { options={...}, element=ul.menutop, rtl=false, more...})mootools-core.js (line 39) initialize(f="ul.menutop", k=Object { pill=0, effect="slide and fade", opacity=1, more...})fusion.js (line 8) initialize()mootools-more.js (line 27) b()mootools-core.js (line 140) g()mootools-core.js (line 135) (?)()school-staff (line 77) fireEvent(f=function())mootools-core.js (line 370) forEach(i=function(), v=Window school-staff)mootools-core.js (line 39) fireEvent(e="domready", c=[], b=undefined)mootools-core.js (line 370) g()mootools-core.js (line 507) [Break On This Error] ...start({"margin-top":this.height,opacity:0}).chain(function(){if(this.childMenu.f... fusion.js (line 8) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
    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