I am new to jqWidgets
In order to minimize server side calls, I have a relatively complex JSON array that embeds other JSON arrays
that I am able to succesfully retrieve from 1 server side call using the $.jqx.dataAdapter. JSON structure looks like this:
{ orderData: [{key1:value1, key2:value2,...},{key3:value3, key4:value4...},....], locationData: [{key1:value1, key2:value2,...},{..},...] . . . }
I am able to successully use the “orderData” array in the above JSON array of arrays to fill a jqGrid.
There is a simple html table (header for the jqGrid)just above the jqGrid div tags that I am unable to fill
with the “locationData” JSON array data. I am attempting to pass the “data” object to a javascipt function
that would in turn attempt to populate a span tag with data using dot notation. Am I missing something? Plase
advise on how to accomplish this.
var dataAdapter = new $.jqx.dataAdapter(source, { downloadComplete: function (data, status, xhr) { //alert('complete:'+JSON.stringify(data)); alert("data.locGeoData: "+JSON.stringify(data.locGeoData)); }, loadComplete: function (data) { //var records = dataAdapter.records; //var length = records.length; //alert("eaData: \n"+records+"\n"+length); prepareHeader(data); }
.
.
.
function prepareEAHeader(data){ //alert("data: "+data); $('#headerText1').text(data.locationData.key1); $('#headerText2').text(data.locationData.key2); }
.
.
.
<td><span id="headerText1"></span></td>
.
.
.
<td><span id="headerText2"></span></td>