Cannot read property 'asSorting' of undefined - when defining columns dynamically

Cannot read property 'asSorting' of undefined - when defining columns dynamically

rachitrachit Posts: 2Questions: 1Answers: 0
edited April 2016 in Free community support

Hi,
I am initializing my datatables in the following manner -
var siteDataTableOptions = {};
siteDataTableOptions.data = siteJson;
siteDataTableOptions.columns = [ {
"width":"15%","title":"<fmt:message key='site.count.readzone' />",
"render" : function(data, type, full, meta){
alert(1);

     }];
           var siteDataTable = $("#siteTable").dataTable(siteDataTableOptions);

          <table id="siteTable" class="harpdataTable" style="width:100%">
    <thead>
    </thead>    
    <tbody></tbody>
       </table>

Apparently this error happens when datatables is not able to find the column list. I am trying to defined columns by using the "columns attribute". Can someone please help and point out whats wrong here

This discussion has been closed.