{"id":6136,"date":"2014-04-13T04:33:52","date_gmt":"2014-04-13T04:33:52","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/13\/uncaught-typeerror-cannot-read-property-classname-of-undefined-collection-of-common-programming-errors-2\/"},"modified":"2014-04-13T04:33:52","modified_gmt":"2014-04-13T04:33:52","slug":"uncaught-typeerror-cannot-read-property-classname-of-undefined-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/13\/uncaught-typeerror-cannot-read-property-classname-of-undefined-collection-of-common-programming-errors-2\/","title":{"rendered":"Uncaught TypeError: Cannot read property &#39;className&#39; of undefined-Collection of common programming errors"},"content":{"rendered":"<p>I got an identical error to the one you&#8217;re getting now. I once encountered a very similar error using the Chosen library. The problem was (in Chosen&#8217;s case) that IDs with the <code>[]<\/code> characters were being used, thus confusing Javascript between css selectors and ids (remember that in CSS we can use <code>[]<\/code> to specify attributes).<\/p>\n<p>In the case of DataTables, however, I noticed that the DataTables script itself was prepending <code>class = \" \"<\/code> before the first element in every tr element within the <code>tbody<\/code>.<\/p>\n<p>The reason for this was because the HTML output from the php had a logical error. The faulting code:<\/p>\n<pre><code>\n        <\/code><\/pre>\n<tr>\n<td><\/td>\n<\/tr>\n<p>There was an error at the bottom of the long, long table, indicating that postgres could not jump to row 208. This told me I needed to stop looping at <code>i - 1<\/code>, or <code>$currentRow - 1<\/code>.<\/p>\n<p>Hence the fixed, working code:<\/p>\n<pre><code>\n        <\/code><\/pre>\n<tr>\n<td><\/td>\n<\/tr>\n<p>Performing this change allowed DataTables to perform properly.<\/p>\n<p>So although I cannot provide a working solution, I do advise you to look at your html mark-up, as that may be the source of your problem (ex, does your table have a <code>tbody<\/code>?).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got an identical error to the one you&#8217;re getting now. I once encountered a very similar error using the Chosen library. The problem was (in Chosen&#8217;s case) that IDs with the [] characters were being used, thus confusing Javascript between css selectors and ids (remember that in CSS we can use [] to specify [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6136","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6136"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6136\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}