Bug in KeyTable?

Bug in KeyTable?

scottnscottn Posts: 13Questions: 0Answers: 0
edited April 2010 in General
Hi,

I am using KeyTable with Data Tables and it appears that if there is a hidden column in your table this breaks KeyTable. Tabbing through the hidden column causes 1) a null object error 2) The rest of the rows to be ignored.

The error occurs on line 397 of Data Tables:

var iRow = _fnFindDtCell( nTarget )[1];

Error: _fnFindDtCell(nTarget) is null

Am I doing something wrong? Really looks like a bug to me...

Scott

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Looks like a bug to me too! KeyTable was incorrectly using the number of columns that DataTables had in it's storage for the calculations, rather than the number of visible columns. Hence the problem when you started to hide certain columns (and it would just get worse for each additional hidden column).

    So I've fixed this and KeyTable 1.1.4 is now available which addresses this: http://datatables.net/plug-ins/#KeyTable

    Regards,
    Allan
  • scottnscottn Posts: 13Questions: 0Answers: 0
    Thanks for the quick response. I will test and let you know if I encounter and issues.
  • scottnscottn Posts: 13Questions: 0Answers: 0
    edited April 2010
    Hi Allan,

    There also appears to be a similure problem in fnGetPosition. The column returned does not include the visible=false columns.

    However, fnUpdate does include invisible columns. So updating via the column number returned by fnGetPosition update the previous column.

    [code]
    var aPos = oWWMaintenanceList.fnGetPosition( this );
    oWWMaintenanceList.fnUpdate( sValue, aPos[0], aPos[1] );
    [/code]

    Scott
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    fnGetPosition should give you both the index when considering hidden columns and without. The return array (for a TD node) is:

    [code]
    [
    aoData index row,
    column index (discounting hidden rows),
    column index (including hidden rows)
    ]
    [/code]
    http://datatables.net/api#fnGetPosition

    Allan
  • scottnscottn Posts: 13Questions: 0Answers: 0
    Thanks. Working great now.
This discussion has been closed.