Can't seem to get the table to display
Can't seem to get the table to display
I was on Beta4 and now on full 1.8 version and for some reason my table will not display and I have trimmed out as much excess options from the table and it still won't show the data. As I've stated in previous examples, JSON array is generated from serialized java classes server side and grabbed by the jsp into the object seen below.
Any help would be appreciated.
Here is the Javascript that is on the page:
[code]
var dataRows = [{contentType: "application/octet-stream",description: null,id: 55514,length: 9004,name: "Database.kdb",uploadDate: "2011-06-07T20:07:37"},
{contentType: "application/octet-stream",description: null,id: 55458,length: 10204,name: "ajshome.kdb",uploadDate: "2011-06-07T19:25:55"},
{contentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",description: null,id: 55500,length: 35040,name: "Adam Swift Resume (7-10).docx",uploadDate: "2011-06-07T19:33:49"},
{contentType: "application/msword",description: null,id: 55444,length: 195072,name: "FIREBIRD_Vision.doc",uploadDate: "2011-06-07T19:04:55"},
{contentType: "application/octet-stream",description: null,id: 55430,length: 9004,name: "Database.kdb",uploadDate: "2011-06-07T19:03:56"}];
var isLongData = dataRows.length > 10;
$("#gridtable").dataTable({
aaData: dataRows,
bInfo: isLongData,
bLengthChange: isLongData,
bPaginate: isLongData,
bFilter: isLongData,
aoColumns: [{mDataProp: "name"},
{mDataProp: "description"},
{mDataProp: "uploadDate"}]
});
[/code]
Here is the table source before:
[code]
File
Description
Upload Date
[/code]
and Here is the table after the page has been loaded:
[code]
File
Description
Upload Date
[/code]
Any help would be appreciated.
Here is the Javascript that is on the page:
[code]
var dataRows = [{contentType: "application/octet-stream",description: null,id: 55514,length: 9004,name: "Database.kdb",uploadDate: "2011-06-07T20:07:37"},
{contentType: "application/octet-stream",description: null,id: 55458,length: 10204,name: "ajshome.kdb",uploadDate: "2011-06-07T19:25:55"},
{contentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",description: null,id: 55500,length: 35040,name: "Adam Swift Resume (7-10).docx",uploadDate: "2011-06-07T19:33:49"},
{contentType: "application/msword",description: null,id: 55444,length: 195072,name: "FIREBIRD_Vision.doc",uploadDate: "2011-06-07T19:04:55"},
{contentType: "application/octet-stream",description: null,id: 55430,length: 9004,name: "Database.kdb",uploadDate: "2011-06-07T19:03:56"}];
var isLongData = dataRows.length > 10;
$("#gridtable").dataTable({
aaData: dataRows,
bInfo: isLongData,
bLengthChange: isLongData,
bPaginate: isLongData,
bFilter: isLongData,
aoColumns: [{mDataProp: "name"},
{mDataProp: "description"},
{mDataProp: "uploadDate"}]
});
[/code]
Here is the table source before:
[code]
File
Description
Upload Date
[/code]
and Here is the table after the page has been loaded:
[code]
File
Description
Upload Date
[/code]
This discussion has been closed.
Replies
[code]
function _fnAddData ( oSettings, aDataSupplied )
2653 {
2654 var oCol;
2655
2656 /* Take an independent copy of the data source so we can bash it about as we wish */
2657 var aDataIn = (typeof aDataSupplied.length == 'number') ?
aDataSupplied.slice is not a function2658 aDataSupplied.slice() :
2659 $.extend( true, {}, aDataSupplied );
2660
2661 /* Create the object for storing information about this new row */
2662 var iRow = oSettings.aoData.length;
...
[/code]
Changed this:
[code]
var aDataIn = (typeof aDataSupplied.length == 'number') ?
aDataSupplied.slice() :
$.extend( true, {}, aDataSupplied );
[/code]
to this:
[code]
try {
var aDataIn = aDataSupplied.slice();
} catch (e) {
var aDataIn = $.extend( true, {}, aDataSupplied );
}
[/code]