Opera filtration bug

Opera filtration bug

zygimantaszygimantas Posts: 33Questions: 0Answers: 0
edited June 2009 in General
Maybe anyone has seen such strange behaviour with Opera (version 9.x and 10.x) and datatables plugin: majority (few of them works!..) of my tables fails at filtering while using with Opera browser. Sorting, paging works nice, no errors in javascript console. After entering any letter, 0 results are displayed. No problems with other browsers, including IE7, IE8, Chrome, Firefox, Safari on Windows and Mac OS X. Page is XHTML 1.0 Strict and valid. Am not not sure yet, it's a problem of plugin or my code. Currenty I'm using 1.5b8 version. Maybe it depends on columns count or data. Has anybody seen such behaviour before?

Replies

  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    I've traced the bug. Filtration fails on Opera then there is a hyperlink inside any other cell (not the same cell I am filtering by). Please check the plugin source.
  • allanallan Posts: 63,113Questions: 1Answers: 10,397 Site admin
    Hi zygimantas,

    I've just been experimenting with:

    http://datatables.net/examples/example_html_sort.html
    and
    http://datatables.net/1.5-beta/examples/api/regex.html (I modified a local copy to have a link in the table)

    And they both work as I would have expected in Opera 9.6 and 10.a.

    Perhaps you could post a link to an example which is failing for you?

    Thanks,
    Allan
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    ok, it's was not exactly related to the hyperlink inside, now I guess it is related to whitespace. I am attaching sample HTML code for indication:

    [code]
    <!DOCTYPE html PUBLIC"-// W3C//DTD XHTML 1.0 Strict//EN"" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


    test





    c1
    c2




    123
    First



    456

    Second







    $(function() {

    $('table').dataTable();
    });




    [/code]

    To to filter by 123 and by 456.
  • allanallan Posts: 63,113Questions: 1Answers: 10,397 Site admin
    Hi zygimantas,

    Thanks for the example code. I've just tried it out and I think I must be missing something here.

    Filter by "123" - result is one row ("123 First")
    Filter by "456" - result is one row ("456 Second")
    Filter by "123 456" - result is no rows

    Is this what you are seeing? I've tried this on Opera 9.6 and 10a

    Allan
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    edited June 2009
    Hm, on Opera 10.00 Beta I see:

    Filter by "123" - Showing 1 to 1 of 1 entries (filtered from 2 total entries)
    Filter by "456" - Showing 0 to 0 of 0 entries (filtered from 2 total entries)

    Same code, saved as local HTML file.
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    Screenshot: http://img199.imageshack.us/my.php?image=opera.tif
  • allanallan Posts: 63,113Questions: 1Answers: 10,397 Site admin
    This is fairly weird. I've just tried on Opera 9.6 Mac, Opera 10a Mac, Opera 10b1 Mac and Opera 10b1 Vista, and they all work as expected.

    The only thing I can see which is odd is your doctype looks a bit skew-whiff. But that probably shouldn't cause the DataTables filtering to fail.

    Does this happen in any other browser for you? Did you try clearing the cache and all that kind of stuff?

    Allan
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    edited June 2009
    No, only in newly installed opera, versions 9.x and 10.0. It works on FF (Win, Mac), Chome, Safari (Win, Mac), IE7, IE8 just fine.
    Tried to delete all cache, the problem remains. That should be not a cache issue, because same problem exists on my co-worker computer using Opera.
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    And after replacing:

    [code]

    456

    [/code]

    to

    [code]
    456
    [/code]

    it works fine in Opera, but that's not always possible in production code.
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    edited June 2009
    Update: I've just installed Opera 10b on Mac OS X. The code above also doesn't work on this browser.
  • allanallan Posts: 63,113Questions: 1Answers: 10,397 Site admin
    This is starting to border on very weird!

    I've put your source into: http://www.datatables.net/dev/test_opera_filtering.html . Could you try that and see if it works as you would expect? It does for me using Opera 10b1 ( Opera/9.80 (Macintosh; Intel Mac OS X; U; en) Presto/2.2.15 Version/10.00 ).

    Allan
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    edited June 2009
    Yes, your page works both on Opera on Mac and Windows.
    But:

    1. Opened your page with Opera.
    2. Copied source (simply using "view source") to new file on my hosting account.
    3. Added datatables plugin to the same directory because the path inside html was relative (no modifications in html file).
    4. Again, it does not work on Opera only :)

    Try this page: http://buyersquad.com/test_opera_filtering.html

    It's one of the funniest bug I've ever seen ;)
  • allanallan Posts: 63,113Questions: 1Answers: 10,397 Site admin
    This is weird... Your example doesn't work for me!

    I honestly can't explain what is going on. I've done a diff between the jquery.dataTables.js scripts that we both employ and they are identical. I am presuming that Google is sending out the same version of jQuery (perhaps worth trying a local copy) and the HTML matches.

    I'm completely lost here! I don't see any reason why it wouldn't work, and it's not going to be a cache issue since I'm seeing exactly the same thing.

    Weird.

    Allan
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    Check this one: http://buyersquad.com/test_opera_filtering_datatables_net.html
    All scripts are downloaded from datatables.net
  • allanallan Posts: 63,113Questions: 1Answers: 10,397 Site admin
    Heh - and here is the identical source here: http://www.datatables.net/dev/test_opera_filtering2.html - works fine.

    Try copying the source files across to your own server, rather than taking them from DataTables.net or google.com. Could be that Opera has some weird cross domain issue.

    Allan
  • zygimantaszygimantas Posts: 33Questions: 0Answers: 0
    ok, try this page: http://buyersquad.com/test_opera_filtering_local_1.html
    and what is the most funny, try this one: http://buyersquad.com/test_opera_filtering_local_2.html
  • allanallan Posts: 63,113Questions: 1Answers: 10,397 Site admin
    Really really odd. I'm at a complete loss...

    This is the line in DataTables which should take account of newlines:
    3286: return sData.replace(/\n/g," ");

    Try changing the sType for the columns to "html". It's looking a bit like an Opera bug to me, but I can't see specifically where it would be, so basing that statement only on the fact that it works in all the other browsers - and for me with the posts that I made.

    One other thing to try is sticking DataTables 1.5 beta 9 onto your server.

    Allan
  • DaniloDanilo Posts: 6Questions: 0Answers: 0
    Hello Allan,

    I am probably having the same/a similar issue and can provide further info.

    I am having this problem in Opera 10.60 on Windows after upgrading from DT 1.6.2 to 1.7.0 and to jQuery 1.4.2.
    Whatever I search for, I immediately get zero results. And when I add "oSearch": {"sSearch": ""} (which is default anyway if I understand correctly) to the defaults, then it works - BUT only with one word, adding a space and a second word returns zero results again (and this even in every browser!).
    Without "oSearch": {"sSearch": ""} it works fine in every browser except Opera, where I get zero results.

    My setup didn't change during the upgrade (except for aLengthMenu but this isn't causing the issue) and is as follows:

    I'm defining defaults like so:

    var oLanguageDE = {
    "oLanguage": {
    "sProcessing": "Bitte warten...",
    "sLengthMenu": "_MENU_ Eintr
  • DaniloDanilo Posts: 6Questions: 0Answers: 0
    Well, further investigation resulted in the following:

    This is NOT a DT issue!

    In my production environment it works ace.
    It is most likely due to corrupt or mis-encoded database records.

    Danilo
  • allanallan Posts: 63,113Questions: 1Answers: 10,397 Site admin
    Hi Danilo,

    Thanks very much for the information. It does appear that Opera is sensitive to something in the search - but I can't tell what at the moment.

    If anyone else encounters this issue, please post a link so I can take a closer look to see what might be going wrong in Opera.

    Regards,
    Allan
This discussion has been closed.