Uncaught TypeError: Cannot read property 'className' of undefined

后端 未结 7 1757
春和景丽
春和景丽 2020-12-31 00:14

The following error is being thrown in Google Chrome\'s developers tools:

Uncaught TypeError: Cannot read property \'className\' of undefined

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-31 00:25

    Another possible cause is if you list more columns in the "aoColumnDefs" attribute than there are "td" elements in the table.

    var yourTable = $('#product-search-results-table').dataTable({
        // If you only have three columns in the HTML table, then this line will cause an error, because it lists four columns in "aoColumnDefs".
        "aoColumnDefs": [{ "bSortable": false, "aTargets": [0, 1, 2, 3] }]
    });
    

提交回复
热议问题