TableTools error with jQuery 1.9.0: .live() is deprecated

TableTools error with jQuery 1.9.0: .live() is deprecated

dnagirldnagirl Posts: 36Questions: 2Answers: 0
edited January 2013 in Bug reports
jQuery 1.9.0 is no longer supporting the .live() method. It should be replaced with the .on() method. Currently TableTools 2.1.4 throws the following error with jQuery 1.9.0:
[code]
$("tr", dt.nTBody).live is not a function
TableTools.js line 1027
[/code]

Editing that line to read [code]$('tr', dt.nTBody).on( 'click', function(e) {[/code] fixes the error.

Replies

  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Committed the change this morning :-). Fix is available in the TableTools 2.1.5.dev nightly on the downloads page. AutoFill also had the same issue and is now corrected.

    Allan
  • smileysmiley Posts: 1Questions: 0Answers: 0
    The correct fix for this should be:

    [code] $(dt.nTBody).on( 'click', 'tr', function(e) { [/code]
  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Agreed - that is the fix that has been committed (with a namespace for TableTools):

    [code]
    $(dt.nTBody).on( 'click.DTTT_Select', 'tr', function(e) {
    [/code]

    This is available in the TableTools nightly.

    Allan
  • paulhickmanpaulhickman Posts: 21Questions: 1Answers: 0
    edited March 2013
    KeyTable also contains 2 calls to live(), and the core dataTables uses attr("selected",true) instead of prop("selected",true)
  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin
    Sorry - I hadn't pushed up the changed for KeyTable. Been sitting here with it fixed for ages! Its now in the nighties. DataTables also is fixed in git.

    Allan
This discussion has been closed.