Quantcast
Viewing all articles
Browse latest Browse all 82145

DataTables not getting populated by Rest services

Hi
I have a datatable wherein the ajax source is Java rest webservice. The webservice is returning me a json object as below:
[{"Name":"name0","Path":"Path0"},{"Name":"name1","Path":"Path1"}]

The script code is as below
$(document).ready(function () {

    var oTable = $('#myDataTable').dataTable({
        
        "sAjaxSource": "http://localhost:8080/api/store/masters",
        "sAjaxDataProp": "",
        "aoColumns": [{ "mData": "Name" }, { "mData": "Path"}]
    });

The server code is being called and it returns the json object but somehow the data table is not populating it. I would appreciate any help.

Thanks

Viewing all articles
Browse latest Browse all 82145

Trending Articles