browser compatibility

browser compatibility

chuckgchuckg Posts: 18Questions: 7Answers: 0
edited January 2022 in General
function formatc ( table ) {
    // video hide compilations checkbox
    var state;
    if (table.state.loaded() === null) {
        state = '';
    } else {
        try {
            state = table.state.loaded()['columns'][COLUMN3]['search']['search'];
        } catch (error) {
            state = '';
        }
    }
    return '<input type="checkbox" id="covdcb" value="hide"'+
            (state === 'hide compilation' ? ' checked' : '')+
            '>Hide Compilations</input>';
}
$(document).ready(function() {
    var table = $('#covd').DataTable( {
        "processing": true,
        "serverSide": true,
        "dom": "<'tbh'l<'compilations'>f>rtip",
        'deferLoading': (coepvd === 'v' ? null : 0),
        "stateSave": true,
        "stateDuration": -1,
        "stateLoadParams": function (settings, data) {
            data.search.search = "";
            },
        "ajax": { "url": "/covd.php",
            "data": function (d) {
                d.CompanyID = companyID;
                }
            },
        "pagingType": "input",
        "order": [[COLUMN0, 'desc']],
        "search": { "return": true },
        "lengthMenu": [ 25, 50, 100 ]
    } );
    // recompute column widths on search
    table.on( 'search.dt', function () {
        table.columns.adjust();
    } );
    // recompute column widths on sort
    table.on( 'order.dt', function () {
        table.columns.adjust();
    } );
    $("div.compilations").html(formatc(table));
    $(document).ready(function() {
        $("#covdcb").change(function() {
            var table = $('#covd').DataTable();
            if ($(this).is(':checked')) {
                table.columns(COLUMN3).search('hide compilation').draw();
            } else {
                table.columns(COLUMN3).search('show compilation').draw();
            }
        });
    });
} );

I have users using unpredictable browsers that I can't test with.
One is using Safari 9 and can't get a search to work.
I use: "search": { "return": true }

Is there any experience with the enter key not working for a search on old browsers?
Catching an enter key seems rather rudimentary.
The user can see the Javascript errors and none show up.

Sorry, I can't share the website so I expect any help here will be pure luck.
I am a little worried that I may have gotten myself into a bind with older browsers.

I was going to experiment with removing the webkit search cancel but that was supported in Safari 3!

Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • kthorngrenkthorngren Posts: 21,322Questions: 26Answers: 4,948

    The user can see the Javascript errors and none show up.

    What are the errors?

    What do you mean by "none show up"?

    I don't have an old browser to test with. Maybe the developers do.

    You could try taking over the keyup event that Datatables creates for the search input and look for the enter key yourself. Something like this:
    http://live.datatables.net/jorexujo/575/edit

    Kevin

  • chuckgchuckg Posts: 18Questions: 7Answers: 0

    The user starts up the developer tools on Safari 9 and sees no javascript errors. Beyond that they don't have the skillset to do more.

    There is really nothing I can do short of connecting to the users' computer and controlling it remotely. Not likely to get permission to do that. It is in Europe and I'm in the US. I see there is a website that let you test old browsers but it is too expensive. Hence my simply hoping there is some experience dealing with old browsers.

    Frankly I probably just have to say "Upgrade!" After all the user is or was a Mac programmer!

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    I'm surprised that there would be compatibility issues, but we would need to be able to see the issue to be able to debug it. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • chuckgchuckg Posts: 18Questions: 7Answers: 0

    Here is a page where the enter key does not trigger a search

    https://datatables.net/examples/server_side/return_search.html

    fails on

    Safari 9.1 (OSX 10.9.5)

    Chrome is Version 65.0.3325.181

  • chuckgchuckg Posts: 18Questions: 7Answers: 0

    Correction: It does work on Chrome 65.

    I've told the user to switch to Chrome although I avoid it as much as possible.

Sign In or Register to comment.