Changes in a function fnAddData() in DataTable (to the following code) has introduced issues with angularJS $resource.query():
this.fnAddData = function( data, redraw )
{
var api = this.api( true );
/* Check if we want to add multiple rows or not */
var rows = $.isArray(data) && ( $.isArray(data[0]) || $.isPlainObject(data[0]) ) ?
api.rows.add( data ) :
api.row.add( data );
if ( redraw === undefined || redraw ) {
api.draw();
}
return rows.flatten().toArray();
};
The return object from $resource.query is an array of $resource objects. The check for whether to add the passed object as multiple rows or not fails because $.isPlainObject returns false. The following error is displayed:
DataTables warning: table id=DataTable_Table_1 - Requested unknown parameter 'xyz...' for row 0. For more information about this error please see http://datables.net/tn/4.
Has anyone found a work-around for this, or am I doing something wrong?