Deep Data JSON

Deep Data JSON

gormanstgormanst Posts: 5Questions: 0Answers: 0
edited December 2011 in General
The below code only works when I remove the first top level JSON object (requestStatus). I have tried every premutation I can think of and found examples for but can't seem to get
to the overview.feedOverview data no matter what, unless of course I remove the first object all-to-gether. Has anyone seen this?
[code]
$(document).ready(function() {

$('#example').dataTable( {
"bFilter": false,
"bPaginate": false,
"bInfo": false,
"bJQueryUI": true,
"bSort": false,
"bProcessing": false,
"sAjaxSource": "http://localhost:9000/MyApp/api/rest/overview/getOverview",
"sAjaxDataProp": "overview.feedOverview",
"aoColumns": [
{"sTitle": "Status", "mDataProp": "status" },
{"sTitle": "Record", "mDataProp": "recordingStatus" },
{"sTitle": "Feed", "mDataProp": "feedName" },
{"sTitle": "Mission", "mDataProp": "missionName" },
{"sTitle": "Start Time", "mDataProp": "startTime" },
{"sTitle": "Stop Timie", "mDataProp": "stopTime" }


]
} );
});
[/code]



// JSON


{
"requestStatus": {
"status": "OPERATION_COMPLETE",
"errorText": null
},
"overview": {
"feedOverview": [
{
"status": "RUNNING",
"recordingStatus": "STOPPED",
"picteId": "1323467287",
"feedName": "Predator",
"missionName": "AnotherMission",
"startTime": "2011-12-09T16:00:00",
"stopTime": "2011-12-09T20:00:00"
},
{
"status": "RUNNING",
"recordingStatus": "STOPPED",
"picteId": "1323468370",
"feedName": "Predator2",
"missionName": "Hello",
"startTime": "2011-12-09T16:00:00",
"stopTime": "2011-12-09T20:00:00"
}
]
}
}

Replies

  • gormanstgormanst Posts: 5Questions: 0Answers: 0
    Sorry I should have put this in the DataTables1.8 category
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    It looks okay to me, and when I put it into the 'live' site it appears to work no problem: http://live.datatables.net/inocod/edit . Are you using 1.8.2?

    Allan
  • gormanstgormanst Posts: 5Questions: 0Answers: 0
    I was using 1.8.2. I downloaded a new version just now and it worked! If you want I could send you the source I was using. Here is the header from the one that didn't work.

    /*
    * File: jquery.dataTables.js
    * Version: 1.8.2
    * Description: Paginate, search and sort HTML tables
    * Author: Allan Jardine (www.sprymedia.co.uk)
    * Created: 28/3/2008
    * Language: Javascript
    * License: GPL v2 or BSD 3 point style
    * Project: Mtaala
    * Contact: allan.jardine@sprymedia.co.uk

    Thx. so very much for responding.
  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    If the latest version works then I think we'll just leave it there :-)

    Thanks for the feedback!
    Allan
This discussion has been closed.