Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery TableSorter Plugin error on init : cannot read property '0' of undefined
    primarykey
    data
    text
    <p>i wanna sort my table with jQuery Plugin TableSorter . So i get this table :</p> <pre class="lang-html prettyprint-override"><code>&lt;table id="stats" class="zebra-striped"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Date&lt;/th&gt; &lt;th&gt;Annonce&lt;/th&gt; &lt;th&gt;Support&lt;/th&gt; &lt;th&gt;Nb Assoc.&lt;/th&gt; &lt;th&gt;Nb Transfo.&lt;/th&gt; &lt;th&gt;Cout&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>So as you can see my table is empty, just had header. So i init tablesorter with empty cell with :</p> <pre class="lang-js prettyprint-override"><code>$("table#stats").tablesorter({ sortList: [[0,0]]}); </code></pre> <p>and immediatly i get this error :</p> <p><code>jquery.tablesorter.min.js:4 Uncaught TypeError: Cannot read property '0' of undefined</code></p> <p>FYI , there's my js loaded : </p> <pre class="lang-html prettyprint-override"><code>&lt;!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if necessary --&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js"&gt;&lt;/script&gt; &lt;script&gt;window.jQuery || document.write('&lt;script src="js/libs/jquery-1.5.1.min.js"&gt;\x3C/script&gt;')&lt;/script&gt; &lt;script src="js/bootstrap-dropdown.js"&gt;&lt;/script&gt; &lt;script src="js/bootstrap-scrollspy.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.tablesorter.min.js"&gt;&lt;/script&gt; </code></pre> <p>Any idea why i get this and how i can make the plugin work again ?</p> <p>Thx</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