Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82566

Data tables not working for Ajax response, giving e[i] is undefined. Not able to resolve issue ?

$
0
0

var Table;
var Set;

function mainTable(){
Table = "";
Set = "";

$.ajax({
    "url": "MyURL", 
           "type" : "POST",
           "success": function(json) {
        alert(JSON.stringify(json));
        var tableHeaders;
        $.each(json.columns, function(i, val){
            tableHeaders += "<th>" + val + "</th>";
        });

        $("#Table").empty();                
       Set = json.data;

      Table =  $('#myTable').DataTable({
            'responsive': true,
            'scrollX': true,
            'scrollY': '350px',
            'data': Set,
            'order': [1, 'asc']
            });
    },
        "dataType": "json"
});

}

My json response is fine, but it is giving e[i] is undefined error ? Not able to solve this


Viewing all articles
Browse latest Browse all 82566

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>