The length of what is undefined?

The length of what is undefined?

traedoriltraedoril Posts: 3Questions: 2Answers: 0
edited April 2015 in Free community support

I am using version 10.0.6 of datatables. I have four columns defined and I am trying to get the data from the server.

I am not sure what "length" the error is referring to.

table

<table class="table table-striped" id="activeProjects">
    <thead>
        <tr>
            <th>Project Name</th>
            <th>Project Number</th>
            <th>Manager</th>
            <th>Architect</th>
        </tr>
    </thead>
    <tbody>

    </tbody>
</table>

AJAX:

[
    {
        ProjectName: "First Project",
        ProjectNumber: "12345",
        ProjectManager: "Tony Stark",
        ProjectArchitect: "Steve Rodgers"
    }
]

DataTable:

$(document).ready(function () {
    $('#activeProjects').dataTable({
        "paging": true,
        "ordering": true,
        "info": false,
        "processing": true,
        "serverSide": true,
        "ajax": "../api/Project/GetAll/",
        "columns": [
        { "data": "ProjectName" },
        { "data": "ProjectNumber" },
        { "data": "ProjectManager" },
        { "data": "ProjectArchitect" }
        ]
    });
});

I am not sure what I am missing to populate the table.

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.