Can't seem to get the table to display

Can't seem to get the table to display

GleebleGleeble Posts: 14Questions: 0Answers: 0
edited June 2011 in General
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]

Replies

  • GleebleGleeble Posts: 14Questions: 0Answers: 0
    edited June 2011
    Firebug is breaking on the following as an error from jquery.dataTables.js: Line 7 (I believe) shows the error.

    [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]
  • GleebleGleeble Posts: 14Questions: 0Answers: 0
    Well, I seem to have fixed it. I was hesitant to go into the javascript to modify things but it is working now after I changed the following. This was all in Firefox 3.6 btw.

    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]
This discussion has been closed.