Newbie Question - fnReloadAjax [object Object]
Newbie Question - fnReloadAjax [object Object]
I am new to most of this - but I think I am fairly close - fnReloadAjax gets called and appears to populate 1 row of the datatable (should be more than the 1) with the exception that I am getting the [object Object] as the data in the fields.... Any help would be greatly appreciated... code is as follows.
[code]
$(document).ready(function() {
$.fn.dataTableExt.oApi.fnReloadAjax = function(oSettings, sNewSource){
oSettings.sAjaxSource = sNewSource;
this.fnClearTable(this);
this.oApi._fnProcessingDisplay(oSettings, true );
var that = this;
$.getJSON(oSettings.sAjaxSource, null, function(json){
/* Got the data - add it to the table */
for (var i=0; i
[code]
$(document).ready(function() {
$.fn.dataTableExt.oApi.fnReloadAjax = function(oSettings, sNewSource){
oSettings.sAjaxSource = sNewSource;
this.fnClearTable(this);
this.oApi._fnProcessingDisplay(oSettings, true );
var that = this;
$.getJSON(oSettings.sAjaxSource, null, function(json){
/* Got the data - add it to the table */
for (var i=0; i
This discussion has been closed.
Replies
{ "aaData":[[ { "unit":"1", "status":"A", "duration":"07:12:19", "response":"", "destination":"" }, { "unit":"2", "status":"A", "duration":"01:32:17", "response":"", "destination":"" }]]}
Allan
The error is (DataTables warning (table id = 'table'): Requested unknown parameter 'unit' from the data source for row 0)
Thanks BTW - datatables looks great - I know it probably sounds pretty bad - but I'm lost - still looking through it though.
Current Code:
[code]
var oTable;
$(document).ready(function() {
$.fn.dataTableExt.oApi.fnReloadAjax = function(oSettings, sNewSource){
oSettings.sAjaxSource = sNewSource;
this.fnClearTable(this);
this.oApi._fnProcessingDisplay(oSettings, true );
var that = this;
$.getJSON(oSettings.sAjaxSource, null, function(json){
for (var i=0; i
aaData is a 2D array of objects. I think what you are actually looking for is a 1D array of objects is it not? i.e. each row is an object in the array.
Allan
BTW - same code except it won't take duration? does that have to do with the ':"?