int sorting: example_ajax_source.html doesn't work

int sorting: example_ajax_source.html doesn't work

dshockdshock Posts: 2Questions: 0Answers: 0
edited March 2009 in General
Hi there!

why is the file "/example_ajax_source.html" not able to sort int? (e.g.: "Engine Version"-column)

Firebug says:
a.toLowerCase is not a function
[Break on this error] return false})}}};$.fn.dataTableExt.oSor...sc":function(a,b){var x=a.toLowerCase();

How can I fix it, so numbers will be displayed corretly? If I wrap those numbers with ", The columns will sort, but not correctly (e.g. 1, 10, 100, 2, 3, ...)

Thank you very much!

Replies

  • allanallan Posts: 63,573Questions: 1Answers: 10,483 Site admin
    Hi dshock,

    Thanks very much for catching this. The issue was that I was assuming that each column was type 'string' when a table was created with 0 length. This used to be needed before I changed fnAddData to take account of type detection, and it has this knock-on effect on Ajax. Removing this assumption allows it all to work nicely.

    The reason it half worked with the '' quotes, is that it cast the number as a string, but of course then we get the dodgy sorting...

    I'll include this fix in 1.4.1 - out tomorrow :-)

    Allan
  • dshockdshock Posts: 2Questions: 0Answers: 0
    Now it works great! Thanks! :)
This discussion has been closed.