Client-Side Ajax Table Not Rendering

Client-Side Ajax Table Not Rendering

triestries Posts: 4Questions: 2Answers: 0

This is driving me crazy. I'm trying to populate a simple table with json from a MVC controller.

Name

$(document).ready(function() {
var table = $('#programListTable').DataTable({
ajax: {
url: "/library/GetProgramData?id=227"
},
columns: [{
data: "Name"
}]
});
});

JSON (shortened) returned from '/library/GetProgramData?id=227'
{"data":[{"ParentProgramID":1179265,"Name":"12 News Daybreak"},{"ParentProgramID":377424,"Name":"12 News KBMT at 10pm"},{"ParentProgramID":377429,"Name":"12 News KBMT at 5pm"}]}

The paging bar shows: Showing 0 to 0 of 0 entries (filtered from 76 total entries)

I know the data is being returned from the server but nothing is rendered. What am I missing?

Answers

  • triestries Posts: 4Questions: 2Answers: 0

    Sorry...here's the HTML.

            <table id="programListTable" class="table table-striped panel-table">
                <thead>
                    <tr>
                        <th>Name</th>
                    </tr>
                </thead>
                <tbody></tbody>
            </table>
    
This discussion has been closed.