Bug in KeyTable fnSetPosition with defer render (DT 1.10)

Bug in KeyTable fnSetPosition with defer render (DT 1.10)

RagingTrollRagingTroll Posts: 34Questions: 3Answers: 0
edited May 2014 in Bug reports

When setting position to a cell that is not yet rendered an error will be thrown

Problem in functions:

My fix for _fnCellFromCoords:

var oData = _oDatatable.aoData[_oDatatable.aiDisplay[y]];
if (oData != null) {
 if (!oData.nTr) {
  _oDatatable.oApi._fnCreateTr(_oDatatable, y); //Create tr if is not yet created
 return _oDatatable.aoData[ _oDatatable.aiDisplay[ y ] ].nTr.getElementsByTagName('td')[x];
 return null;

Fix and optimization for _fnCellFromCoords (instead of looping through all rows and cells, get the cell parent tr and get its property _DT_RowIndex. We have a complexity of O(num_column) instead of O(num_column*num_rows)):

var nTr = nTarget.parentNode;
if (nTr != null) {
 var nTds = nTr.getElementsByTagName('td');
 for ( var j=0, jLen=nTds.length ; j<jLen ; j++ )
  if ( nTds[j] == nTarget )
   return [j, nTr._DT_RowIndex];



  • allanallan Posts: 56,444Questions: 1Answers: 8,957 Site admin

    KeyTable is going to get a rewrite soon. This error might be corrected by the changes that I need to DT core for the other bugs you've raised, but I'm not going to specifically target this bug due to the upcoming rewrite.


This discussion has been closed.