0

Iam creating a Datatable using jquery and I want to pass an array of data to populate the table data.

This is what I do:-

   var dataArray = [];
        for (var i = 0; i < data.Data.length; i++) {
            var temp = {};
            temp['east'] = data.Data[i]["east"];
            temp['west'] = data.Data[i]["west"];
            temp['north'] = data.Data[i]["north"];
            temp['south'] = data.Data[i]["south"];
            dataArray.push(temp);
        }

        $('#mDataTable').DataTable({ "columns": columnTitles, "data": dataArray });

But I get the following error:-

enter image description here

My array is an array with objects. How can I solve this? Any help is appreciated

iam stack
  • 97
  • 1
  • 4
  • 12
  • 1
    what is `columnTitles`? – markpsmith Dec 30 '14 at 09:25
  • As @markpsmith suggest, we need to see columntitles and the markup / HTML. This error is by 99.99999% caused by a mismatch between either data and the markup, or references in code to non-existing columns. – davidkonrad Dec 30 '14 at 12:28

0 Answers0