DataTables 1.8.2

DataTables CDN files for DataTables 1.8.2. This software was originally released on 10th September, 2011.

Release notes

It has been two months since the last DataTables release, so this is a reasonably big one in terms of a number of nice (albeit it small) new features being added and bug fixed. The major new features include a new callback function called fnServerParams which makes it trivial to send additional parameters to the server when making an Ajax request (so you no longer need to write a custom fnServerData method). Also included is the ability to set the thousands separator using the oLanguage.sInfoThousands option rather than needing to write a custom number formatting function. In terms of bug fixes a few issues with the table width when scrolling have been addressed as well as a number of other small issues.

One other point of note is that the examples now all have syntax highlighting on the code example, and any example which uses Ajax shows the latest response from the server, so it is easy to see what is going on!


  • New: fnServerParams callback function - this allows additional parameters to be added to the XHR for server-side processing or Ajax sourced, client-side processed data, with ease. Previously it was required to override the fnServerData method just to add a couple of parameters, but the built in fnServerData method is quite comperhensive and you don't want to have to reproduce all of that unless you need to. Now you don't need to :-). fnServerParams is called on each request, so it is ideal for adding extra parameters such as search parameters which can be updated by users.
  • New: Add a thousands separator option to the language options. As a displayed string in DataTables this should be configurable, and now is with the oLanguage.sInfoThousands options ( "oLanguage": { "sInfoThousands": "'" } for example).
  • New: If a data source is found to be a function, then the function is executed and the return used for the cell display (+sorting, filtering etc). This is useful for integration with knockout.js and backbone.js etc.
  • New: All examples which show Ajax requests now show the JSON response from the server (highlighted to be readable JSON formatting) and the responses shown will update with each additional request. The idea is to make the formatting that DataTables expects / can cope with more obvious
  • New: Syntax highlighting for the examples and provide a link for DataTables initialisation options to the reference page
  • New: In the syntax highlighting also pick out DataTables' API methods and link them to the reference page
  • New: experimental: Add custom events into DataTables - the events available are "draw", "filter", "sort", "page" and "xhr". These are very useful for knowing when these actions happen and binding an action to them. Useful for plugin developers and developers using DataTables both. Note that it would be possible to put in a _LOT_ more custom events ("predraw" etc) which is why this feature is currently considered experimental. It will not be documented in the DataTables documentation until this has stabilised (likely 1.9 or 2.0) and a scheme has been fully confirmed for these events, but I want to include them now to see if and how they are used by developers to see them or talk to me (as this has been asked for a few times). I'm also slightly concerned about the overhead that would be generated if there were custom events for everything.
  • Update: Use $.extend for the language options - its quicker and easier! The init options should be done like this as well, but that will likely be 2.0 due to the way it is currently implemented...
  • Update: to latest jQuery - 1.6.3
  • Update: Split the Ajax parameter building into it's own function (_fnAjaxParameters) so it can be called through the oApi parameter. The intention is that external programs such as TableTools can build up the same parameter set as TableTools uses.
  • Update: correct "stripe" spelling (strip is still backwards compatible though)
  • Fix: Unit test compatibility fix for IE7
  • Fix: HTML column type could sometimes be overridden by the string sorting type. If a cell was found to have just a string and no HTML in it then the whole column would be treated as a string column, even if other cells had HTML. Now put a check in place to ensure that string can't overrule html type. Unit test added.
  • Fix: In webkit browsers the cursor in the active filter would always jump to the end of the input string due to an incorrectly matching elements (after the introduction of the label tag for the filter). Use a jQuery selector to make this more robust.
  • Fix: Due to the jQuery $('>...') selector syntax being deprecated, change the format to use the 'children' option instead
  • Fix: Nested tables in the the main table's header wold cause an error due to too many TR elements being selected by the header detection method. We want to pick up only the child elements of the header - 6485
  • Fix: Array detection for input data was dodgy - an object with a paramater that has a name of 'length' would mess things up - 6271
  • Fix: Table width issues with y-scrolling enabled. Some of the caluclations which were introduced into 1.8.1 to stop the table getting smaller than it can be were wrong under certain conditions. This changes should address this but further testing is required due to the number of variations.
  • Fix: IE6/7 when y-scrolling was filtered to a list without y-scrolling would lose the width of the scrollbar (i.e. not expand to fill the empty space). The IE6/7 specific calcuation needs to be done only when the element is overflowing.
  • Fix: Don't rebuild the client-side search array when using server-side processing since it isn't used! - 5742
  • Fix: Fix typo in internal variable name - "asDestoryStrips" should have been "asDestroyStrips"
  • Fix: Examples - Typo for aaData reference - 6096
  • Fix: The scrollbar width calculation could sometimes be wrong when trying to calculate the size of the bar due to CSS styles. The inner P element could be given padding for example which would result in the scrollbar width being wrong and thus any calculations later on witht he scrollbar width would be incorrect.
  • Fix: typo in example code
  • Fix: IE7 doesn't like setAttribute('rowspan') (and colspan) so we need to do it the old fashioned way... - 6012
  • Fix: typeof null is an object, which causes issues in fnUpdate when checking if a value passed in is an object or not to fail if null is given as the value. Need to check for null values - 5987
  • Fix: Add a method for plug-ins to have a destructor for when DataTables is destroyed - allowing clean up of events and anything else the plug-in has done. Plug-ins should add an object to aoDestroyCallback with 'sName' (to identify the plug-in) and 'fn' as the plug-ins destroy function.
  • Fix: When applying the sanity width for y-scrolling only we need to know if the scrolling element has scroll bars visible or not. Previously we checked if the element was bigger than the visible area, but this isn't good enough of overflow:scroll is set. Need to check that parameter as well - 5658
  • Fix: Only include jQuery once in examples...
  • Fix: Spelling fixes
  • Fix: Correct spelling for the internal function _fnAdjustColumnSizing (was _fnAjustColumnSizing) - from pull request 11.
  • Fix: When filtering is applied to a table which has y-scrolling, and the filter was sufficient to make the scrolling disappear, the table width would increase by the scrollbar width. This was of course incorrect and the result of a change for 1.8.1 - we need to test is the scrollbar is present or not for the fix to be correct, which it now does. Unit test added.
  • Fix: As with the fix in 1.8.1 for the x-scrolling appearing when disabled the footer needs the same consideration as the header, otherwise it can be cut off visually.