Bug: tr:even and tr:even (colon) should be tr.even and tr.odd (dot)?

Bug: tr:even and tr:even (colon) should be tr.even and tr.odd (dot)?

KKellyKKelly Posts: 2Questions: 0Answers: 0
edited June 2012 in Bug reports
In the datatables source, shouldn't the search for tr:even and tr:odd (with a colon), be tr.even and tr.odd (with a dot)? They throw an exception in Opera.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    The only place that DataTables uses :even and :odd is here where it is restoring original row classes on a table destroy:
    https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L5348

    :even and :odd are jQuery selectors ( http://api.jquery.com/even-selector/ ) and my intention with that particular code was to get the odd and even rows and so I believe the code is correct (indeed the odd and even classes will already have been removed by the destroy at that point).

    I've just tested this in Opera 11.52 and 12.00 (Mac) and I'm not seeing any errors on the console. Perhaps you can link me to a test case showing the issue please?

    Allan
  • KKellyKKelly Posts: 2Questions: 0Answers: 0
    Oops, Right, I should have recognized that as a jQuery selector. I'm seeing it in our corporate network and, unfortuanetly I can't give out access to that but I just tested it here and see that I'm running with Opera settings -> scripts with "Show parse errors and break on exceptions" checked. When I uncheck it, everything continues happily. I like Opera because it's extremely picky when you want it to be and nothing wanky gets passed without some error being shown. Problem solved, my error. Thanks for the speedy reply and datatables is nice to have around, very well done.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Good to hear you've got it going again - however, interesting because it should work! I wasn't seeing any Javascript errors in Opera at all, but I suppose there might be some compatibility issue with jQuery somewhere. I'll keep an eye out for any similar reports.

    Regards,
    Allan
This discussion has been closed.