KeyTable + external oLanguage file + _iDisplayEnd < _iDisplayLength

KeyTable + external oLanguage file + _iDisplayEnd < _iDisplayLength

grotibogrotibo Posts: 2Questions: 0Answers: 0
edited November 2010 in Bug reports
Hi,

I have found a bug with KeyTable and the following specifications:
- having an external oLanguage file
- having less than 10 rows to print

With this options, you will get the error:
aoData is undefined (corresponding to the line 3036 of datatable.js)

(i'm working with the nightly versions of DataTables and KeyTable)

It seems to be due to the oSettings variable sends from KeyTable.js (line 454) which is instantiated with the default options (_iDisplayEnd = 10 so the loop line 3033 will get an error...).

I have resolved my problem by putting the KeyTable initialization into the fnInitComplete function of DataTables but maybe you have a better solution.

Regards,

Replies

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    I think that fnInitComplete is probably the right thing to do here. When loading an external language file DataTables must do an XHR to the server to get the language information - being asynchronous this effectively breaks the 'thread' and means that KeyTable will initialise before DataTables has completed it's own - which is not what you want to happen. fnInitComplete is there to be used for exactly this kind of thing :-)

    Allan
This discussion has been closed.