Sorting bug/error Chrome Specific need work around

Sorting bug/error Chrome Specific need work around

monkeytoothmonkeytooth Posts: 22Questions: 0Answers: 0
edited April 2012 in General
Ok I have been tryin to find an answer for a couple days, can't seem to find it, however to save my self some time on retyping it all out I will just share my link from stackover flow. If you'd be so nice to just check it out, if your able to help me any which way, please. Thank you

http://stackoverflow.com/questions/10238240/jquery-datatable-sorting-bug-error-chrome-specific-need-work-around

Replies

  • allanallan Posts: 63,236Questions: 1Answers: 10,418 Site admin
    Hi,

    Can you link to a test case showing the problem so I can run it in Chrome here and discover what is going wrong with it?

    Thanks,
    Allan
  • monkeytoothmonkeytooth Posts: 22Questions: 0Answers: 0
    I would love to, but the only test case I have available is behind a VPN that I'm not allowed to give access to, what I can tell you though is there seems to be no actual problem with it that I can figure out from the life of me. The sorting works on all browsers except chrome, and even then its specific to this table. I have found other tables in this project that have similar data in them that sort no problem. If you look at the note I posted on stack you can see a screen shot image of what its doing in chrome only.

    Along with the source for that particular table as far as the javascript is concerned at least
  • allanallan Posts: 63,236Questions: 1Answers: 10,418 Site admin
    Can you run your table through the DataTales debugger from Chrome ( http://debug.datatables.net ). That might be able to show what the problem is - although I'm not sure. I'd most certainly need the HTML to be able to see what is happening if nothing else :-)

    Allan
  • monkeytoothmonkeytooth Posts: 22Questions: 0Answers: 0
    Debug thing is nice
    http://debug.datatables.net/etekog
  • allanallan Posts: 63,236Questions: 1Answers: 10,418 Site admin
    It looks to me that Chrome is sorting the first column with the HTML included - which it shouldn't be doing. I see that you are using DataTables 1.7.6 - I'd suggest updated to the latest 1.9.1 first of all to see if that addresses the issue - you might want to look at the update notes: http://datatables.net/upgrade/1.9 .

    Allan
  • monkeytoothmonkeytooth Posts: 22Questions: 0Answers: 0
    Is there any notes for upgrading 1.8.x to 1.9.x? Or was the dot release just fixes and no effect over functionality per say as far as just dropping the file in and swapping it out and calling it an upgrade?
  • monkeytoothmonkeytooth Posts: 22Questions: 0Answers: 0
    Also curious, is there anything I can consider looking at api/option wise that may help me adjust the sorting, so it stops the HTML inclusion in the sort?
  • monkeytoothmonkeytooth Posts: 22Questions: 0Answers: 0
    Between what you said and reading more into the api's and then reviewing the code more extensively I found my issue is ultimately the way the table(s) is configured. However I'm having trouble sorting it out and fixing it.

    What it is is 5 columns 2 hidden so..
    0 is the column with the inital sort issue that sparked this post.
    1 is supposed to be display purpose only
    2 is hidden and is supposed to act as the sort for 1
    3 is supposed to be display purpose only
    4 is hidden and supposed to act as the sort for 3

    Now I have no idea exactly how to say what it does when I try to do fix it but every way I shift it around, or redo it seems to fail for me..

    This is the inital block of "aoColumns[ ]"
    null,
    {"iDataSort": 2, "bSortable": true},
    {"bVisible": true, "sType": "num"},
    {"iDataSort": 4, "bSortable": true},
    {"bVisible": true, "sType": "num"}

    ive tried to take null off and sType to HTML, ive tried to mix and match the above a few different ways
    even tried just
    { "sType": "html", "bSortable": true},
    { "sType": "num", "bSortable": true},
    { "sType": "num", "bSortable": true}

    (before I realized I had 2 hidden columns) Which this worked but broke the table layout physically. So now Im stuck trying to go from a to b keeping all 5 columns the 3 displayed, and the 2 hidden and failing
  • allanallan Posts: 63,236Questions: 1Answers: 10,418 Site admin
    > Is there any notes for upgrading 1.8.x to 1.9.x?

    Links just below the Download button for 1.9: http://datatables.net/download ! :-)

    > Also curious, is there anything I can consider looking at api/option wise that may help me adjust the sorting, so it stops the HTML inclusion in the sort?

    DataTables should do that automatically. However, from your following comments it sounds like you want a numeric sort with HTML data. For that you currently need to use a plug-in:
    http://datatables.net/plug-ins/sorting#numbers_html
    http://datatables.net/plug-ins/type-detection#numbers_html

    Allan
This discussion has been closed.