Scroller datatables sorting bug in IE7

Scroller datatables sorting bug in IE7

sykomaniacsykomaniac Posts: 4Questions: 0Answers: 0
edited March 2012 in General
Hi,

I have an issue with IE7 and datatables that use a scroller. The sorting of columns is applied once and once only i.e. you can click to sort by a column (which works) and then clicking to sort any other column (or the same one again) does not resort the table. Somehow the click events are being unbinded. I have tried to debug this but it is beyond me! I have also tried the latest nightly and this issue persists.

Can anyone help?

Also running IE9 with IE9 standards works perfectly but running IE9 in IE8 or IE7 standards causes the same issue described above.

The code that reproduces this issue is as follows:
[code]









Blank
Date
Description
Type
Source
Contact
Speciality
Organisation
RecordType
ActionStatus




1
2
3
4
5
6
7
8
9
10


10
9
8
7
6
5
4
3
2
1





$('#datatable').dataTable({
"sScrollY": "30px"
});



[/code]

Replies

  • sykomaniacsykomaniac Posts: 4Questions: 0Answers: 0
    Shameless bump! Really stuck on this...
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    Looks like a bug in the current nightly I'm afraid - looking into this now.

    Allan
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    That was a bit complicated! It looks like IE6/7 will not completely separate elements when you clone them using cloneNode - their events are the same (presumably a simple pointer). So if you clear the event on one, you clear it on the other as well - which is what was happening here :-(

    I found a jQuery bug which relates to this and added a test case: http://bugs.jquery.com/ticket/10437 . Not really a jQuery bug, more of an IE issue, so I've modified the way DataTables works for the node cloning when scrolling and that allows everything to go back to the working state that it should be in :-) . You can pick the change up from the latest nightly and will be in 1.9.1.

    Thanks for the bug report!

    Regards,
    Allan
  • sykomaniacsykomaniac Posts: 4Questions: 0Answers: 0
    edited April 2012
    Thanks! I was just going to post what the offending line was but you beat me too it.

    I have tried this and it works perfect. 1 things noted about the latest nightly though:

    * You can't set sZeroRecords in oLanguage you get an oDefaults is not defined error.

    Big donation coming your way when I get paid this month.
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    > You can't set sZeroRecords in oLanguage you get an oDefaults is not defined error.

    How embarrassing *blush*. Sorry about that - I've just committed a fix for that as well :-)

    > Big donation coming your way when I get paid this month.

    :-) Thanks very much! Delighted you are enjoying using DataTables!

    Regards,
    Allan
  • sykomaniacsykomaniac Posts: 4Questions: 0Answers: 0
    Once again thank you very much :)
This discussion has been closed.