jquery.browers not supported anymore

jquery.browers not supported anymore

tknoptknop Posts: 14Questions: 0Answers: 0
edited December 2013 in KeyTable
Hi guys,

I'm trying to use the plugin KeyTable, but unfortunately, it isn't working properly... I've a jquery error that blocks the display of the datatable, when using KeyTable. My console says : "TypeError: jQuery.browser is undefined". The error is at line 26 from KeyTable.min.js. I read that the jquery.browser call was removed since jquery1.9.

Here are how i initialize the KeyTable :

[code]
var keys = new KeyTable({
'table': document.getElementById('attending_day1'),
'datatable': oTable
});
[/code]

after initializing the datatable.

I tried to download the 1.1.8.dev version of the plugin, but the jquery.brower call is still present.

However, it seems that no one on this forum is experienceing the same issue..

Do you have any ideas?

Thanks!

Replies

  • allanallan Posts: 61,622Questions: 1Answers: 10,090 Site admin
    Sorry, the nightly on this server isn't up-to-date for some reason. The latest version doesn't have this issue: https://github.com/DataTables/KeyTable/blob/master/js/KeyTable.js . I will be issuing a release of KeyTable soon (and all other plug-ins in preparation for DataTables 1.10 beta 1).

    Allan
  • tknoptknop Posts: 14Questions: 0Answers: 0
    edited December 2013
    Thanks Allan ! Works fine !

    I've another question : i want to change the background of a cell when selecting it and its working. However, i want to be able to re-click on the same cell to fire another background switch, but without being obliged to select another cell before.

    My problem is that the cell does not want to loose the focus. I tried to change the focus programmatically, for exemple by setting the focus on the search bar, which works fine. However, it seems that the previous selected cell still has the focus. I event tried to manually remove the focus class on my cell, which works, but i still have the same issue... I suppose this is because the selection action is totally dependent of the focus action, right ?

    Here is my part of code :

    [code]
    var keys = new KeyTable({
    'table': document.getElementById('attending_day1'),
    'datatable': oTable
    });
    keys.event.focus(4,null,function(td,x,y){
    var bg = $(td).css('background-color');
    if(bg == 'rgb(242, 222, 222)'){
    $(td).css('background-color', '#fcf8e3');
    $(td).removeClass('focus');
    $('div.dataTables_filter input').focus();
    } else if(bg == 'rgb(252, 248, 227)'){
    $(td).css('background-color', '#dff0d8');
    $(td).removeClass('focus');
    $('div.dataTables_filter input').focus();
    } else if(bg == 'rgb(223, 240, 216)'){
    $(td).css('background-color', '#f2dede');
    $(td).removeClass('focus');
    $('div.dataTables_filter input').focus();
    }
    });
    [/code]
    Do you have any ideas how to resolve this ? Is it possible to programmatically select another cell and therefore force my selected cell to loose the focus ?

    Thanks for your precious help,
  • allanallan Posts: 61,622Questions: 1Answers: 10,090 Site admin
    edited December 2013
    If you want to remove focus from KeyTable use the fnBlur method: https://github.com/DataTables/KeyTable/blob/master/js/KeyTable.js#L109 . Remember it doesn't really get "focus" in the `:focus` sense - its just a shim layer.

    Allan
  • tknoptknop Posts: 14Questions: 0Answers: 0
    Thaaaaaanks Allan!!!!
This discussion has been closed.