Big datatable stops at "Processing..."

Big datatable stops at "Processing..."

neajneaj Posts: 8Questions: 0Answers: 0
edited August 2012 in General
Hi all ... I have a big fat datatable with 466 rows coming from a slow server.
When the page finishes loading, the table is blank with the "Processing..." notification showing.
As soon as I hit the "Next" link, the first page of rows appears.

What's going wrong here? How can I ensure that the first page of results shows up on load?

I don't want to publish the contents of the table to the world, but the config as reported by debug is as follows:

[code]
DataTables 1.9.2

Data source Javascript
Processing Client-side
Draws 0
Columns 19
Rows 466
Display start row 0
Display length 10

Auto width Disabled
Deferred rendering Enabled
Filtering Disabled
Length change Enabled
Pagination Enabled
Processing indicator Enabled
Scrolling None
Sorting Enabled
State saving Disabled
Table information Enabled
[/code]

The table state looks a bit suspect (why would total and display be 0?):

[code]
Display start row 0
Display length 10
Records total 0
Records display 0
[/code]

All the data is present in the debug log. (I couldn't figure out where to find it in Firebug.)

Any advice would be sorely appreciated.

Replies

  • neajneaj Posts: 8Questions: 0Answers: 0
    This page still works up to 150 rows. When the dataset is 180 rows, we're looking at "Processing..." forever.

    I might mention that this *used* to work for the whole dataset using datatables 1.7.2
  • allanallan Posts: 63,395Questions: 1Answers: 10,451 Site admin
    That does look odd - but I'm afraid we would actually need to see the problem to be able to offer much help. I can't think, off the top of my head, what would be going wrong.

    Allan
  • neajneaj Posts: 8Questions: 0Answers: 0
    I created a copy on a different URL to try and reproduce this for debugging, but the new instance renders the full dataset flawlessly, running the same software. So it must be something else going wrong on the original page. If I do manage to narrow it down to something reproducible, I'll follow up again. Thanks for an awesome library.
  • allanallan Posts: 63,395Questions: 1Answers: 10,451 Site admin
    I'd suggest looking at Firebug and seeing what that says. I think there will either be a security exception for XSS or a JS error.

    Allan
  • neajneaj Posts: 8Questions: 0Answers: 0
    You're right of course, somehow I was missing the error. It is

    [code]TypeError: a is null[/code]

    in this line: https://github.com/collective/collective.js.datatables/blob/master/collective/js/datatables/resources/media/js/jquery.dataTables.js#L11827

    [code]return a.replace( /<.*?>/g, "" ).toLowerCase();[/code]

    When I specify [code]"bSort": false[/code] rendering succeeds, so my table contains some unsortable values.
  • allanallan Posts: 63,395Questions: 1Answers: 10,451 Site admin
    Running it through the debugger, with sorting disabled, might allow us to see what data is causing the problem.

    Allan
  • neajneaj Posts: 8Questions: 0Answers: 0
    Sorry, I should have given all the details:

    I set a breakpoint in Firebug and ran with sorting enabled, and inspected aoData[i] one frame up from where the exception is raised, namely: https://github.com/collective/collective.js.datatables/blob/master/collective/js/datatables/resources/media/js/jquery.dataTables.js#L3968 (referencing this, because it's the version I'm using).

    That showed me that two columns contained null values. They corresponded to Python None values in my data source method. Substituting the string "Missing" for None fixed the display.

    Possibly datatables could cast everything unsortable to strings (but that may be nasty magic). At any rate, it would be helpful to _fnLog that there's a problem.
This discussion has been closed.