nCell.className is undefined in _fnGatherData

nCell.className is undefined in _fnGatherData

rprussellrprussell Posts: 4Questions: 0Answers: 0
edited May 2012 in Bug reports
Hi all -

This seems to be the same error as was seen and fixed here:
http://datatables.net/forums/discussion/6095/scrollbar-issues/p1

I'm using the dataTables primarily to get a static header and scrolling data body, but have yet to get it working.

SOMETIMES - and this is the maddening part - I get the error "Line: 634 Error: Unable to get value of the property 'className': object is null or undefined" when trying to convert the table.

It's a straight HTML table with and sections. It is rather large, though.

I've run the code through the W3 validator to make sure there are no hanging tags.

The problem seems to arise at line 592, nCell = nTds[ (iRow*iColumns) + iColumn ];

iRow * iColumns + iColumn is 352 * 29 + 0 = 10208 and the tds array has only got 10,200 entries in it.

The jQuery I'm using to initialize the table is:

$("#bigDataTable").dataTable( {
"sScrollY": "300px",
"bSort": false,
"bFilter": false
});

I have a *hunch* that the issue is that I am using rowspans inside each data row. So each data row has the equivalent of a row header, then two sub-rows (over/under) and a row "trailer" which also spans both sub-rows:

DA | line 1 | DA
TA | line 2 | TA

Er. "DATA" is intended to imply a single cell - with two lines in between. So when it tries to do the rows * columns thing, every other 'row' is really missing some due to the rowspans at the front and back of the rows.

I would love to be able to point you at a web page, but it's internal and VPN'ed and proprietary. I can try to PM you a screenshot of the header and a couple of data rows, if that would be helpful at all?

Thanks a bunch,
Rob

Replies

  • rprussellrprussell Posts: 4Questions: 0Answers: 0
    I'll also point out that there are 400 rows total in the table - so bombing at 352 means it ran out of cells pretty early.
  • rprussellrprussell Posts: 4Questions: 0Answers: 0
    OKAY. Update. Using the nightly build from May 2 2012.

    I put a 'phantom' cell underneath each rowspan=2 in the data row, so:


    DA TA
    line 1
    DA TA



    line 2



    The HTML table itself renders the same as before.

    Now I hit ""
    at line 3530 in _fnCalculateColumnWidths: nThs[i-iCorrector].style.width = "";

    iCorrector is zero. i is 4 and nThs is

    ?nThs
    [...]
    [0]: {object}
    [1]: {object}
    [2]: {object}
    [3]: {object}
    [13]: {object}
    [26]: {object}
    [27]: {object}
    [28]: {object}

    (not that 4 is conspicuously missing.)

    I haven't a clue on this one. Progress, I suppose?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    > DA TA

    DataTables does not support colspan or rowspan in the TBODY I'm afraid: http://datatables.net/faqs#unknown_parameter

    Allan
  • rprussellrprussell Posts: 4Questions: 0Answers: 0
    Dang. I was wondering how you'd even handle that after I figured out the issue...

    Thanks for the confirmation.
This discussion has been closed.