DataTables 1.9.1

DataTables CDN files for DataTables 1.9.1. This software was originally released on 15th April, 2012.

Release notes

It has now been over two months since the release of DataTables 1.9.0 and its now time for an update to address the issues that have been shaken out since that major release, and also introduce a couple of new features and updates to round the distribution off. In terms on new features, the most visible are three new static API methods (fnTables, fnIsDataTable and fnVersionCheck), which can be access through $.fn.dataTable.{function}, and provide the ability to get the DataTables initialised on the page, check is a table is available and perform a compatibility check. Also new in this release is the ability to specify if you want TD or TH cells to be created for cells in a column, which can be useful for accessibility. There are also a good few updates and bug fixes, all of which are in the release notes below.

This package also includes updates for the extras: TableTools 2.0.3, Scroller 1.0.2, FixedHeader 2.0.6 and FixedColumns 2.0.3

  • New - API: Static API method - fnVersionCheck same as the version check that is already available as an instance method, but here available as a static API method attached to $.fn.dataTable
  • New - API: Static API method - fnIsDataTable - check if a TABLE node is a DataTable or not
  • New - API: Static API method - fnTables - get the DataTables that are initialised on the table (optionally limit to just the visible tables)
  • New - Initialisation: Column option "sCellType" - allows you to create TD (default) or TH cells for a column. Useful for creating row headings in the TBODY.
  • New - Initialisation: The _START_, _END_, _MAX_ and _TOTAL_ macros for the information language strings can now be used in any info string, rather than being limited to just the ones noted in the documentation - a new internal function called _fnInfoMacros is introduced to allow this to work - 9211
  • New - Initialisation: iDeferLoading can now also be an array allowing the developer to specify the number of records before and after filtering for the information display - 7936
  • New - Core: "destroy" event - when the table is destroyed the destroy event is now triggered. This is very similar to how aoDestroyCallback worked before, but this brings the implementation into line with the newer callback/events mechanism used in DataTable
  • Update - API: Bring the mDataProp as a function functionality to parity for Ajax / JS sourced data and DOM sourced data. Previously DOM sourced data would call the 'set' option for the mDataProp function but Ajax/JS sourced data would not, resulting in the set option never being called for those table types, which is a total bummer when you want to do some formatting in the set option. So now it is called. I was slightly conerned about the performance hit since this means a couple of extra function calls for each cell, but its all in JS, no DOM and I can see virtally no difference with about 50'000 rows and 5 columns of data, so acceptable for the benefits.
  • Update - Docs: Add documentation note on the fact that mDataProp as a function can get a 'type' of undefined when raw data is expected to be returned
  • Update - CSS: Add -webkit-overflow-scrolling: touch; to the scrolling container to provide much improved scrolling interaction in browsers that support that (iOS5, and possibly new Android?)
  • Update - examples: Update the text for the two jEditable examples
  • Update - Examples: Tabs and scrolling updated to use the new static fnTables method
  • Update - Examples: When the node to show the XHR return is not available, don't try to use it
  • Update - Examples: Update demo SSP PHP code
  • Update - Examples: Scrolling paging plug-in now uses A tags (based on the updated two button paging for 1.9), has full accessibility and jQuery UI support
  • Update - Examples: Update the JSONP and pipelining examples to store the returned jqXHR object in the settings object. Helpful for the debugger so we can see what the sever says
  • Update - Core: When throwing an error, throw a "new Error()" so we can get a bit more information about the error
  • Update - Core: When using custom sort data types, if the returned array is not of the required length (aoData.length), then an error is thrown
  • Update - Core: Remove unused variables from fnUpdate
  • Update - Core: Remove unused variables from fnSetColumnVis
  • Fix - API: The parameter for fnDraw was inverted by mistake in the 1.9.0 release - 7825
  • Fix - Performance: Don't extend the passed in data a second time - its a waste of time
  • Fix - Examples: Remove link to custom column ordering - now recommended mDataProp
  • Fix - Examples: Single row selection could have a JS error if deleting a row when no rows selected
  • Fix - Docs: Link to sDom from bFilter was incorrect
  • Fix - Docs: fnStateLoad documentation referred to fnStateSave instead of itself
  • Fix - Docs: Parameter for filtering options in state saving examples should be oSearch, not oFilter - 8408
  • Fix - Docs: fnStateSaveParams referred to fnStateLoadParams in the example code - 8408
  • Fix - Docs: 8400 - mDataProp when null incorrectly suggested that sDefaultContent was an empty string. It is in fact null. Also typo fixes.
  • Fix - Docs: Show oSettings parameter in fnDrawCallback example - 9067
  • Fix - Docs: Typos
  • Fix - Docs: fnSort documentation updated to indicate column sorting - 9094
  • Fix - Unit test: With the change to allow info macros in any of the strings the unit tests need updating to reflect this
  • Fix - Unit test: Number of errors in this test
  • Fix - Unit test: Async behaviour could cause test to fail since the init might not have been complete (amazing that it was passing all this time - faster computers and faster JS engines now causing it to fail!)
  • Fix - Core: IE8 bug where an empty string read from a DOM input element is JSON encoded as '"null"' - absolutely mental! See this blog post for more information .
  • Fix - Core: When mDataProp is given as a function, an error in getting the data would be rather ugly - 8400
  • Fix - Core: Settings object model was missing the nScrollHead and nScrollFoot properties from the documentation
  • Fix - Core: Captions which were positioned using caption-side:bottom (CSS) would be positioned incorrectly if using a scrolling table. Need to work around webkit bug 83867 to address this and add an empty tfoot element if one is not given - 2022
  • Fix - Core: When scrolling and row height collapse was enabled, it was possible that the table column width applied would be too small due to the fact that a scrollbar would be shown for a fraction of a second, due to the height of the scroll body container enforced by the scroll collapse. Fix is to take into account the header height before the width calculation is done
  • Fix - Core: Scrollbody height in IE7- - use offsetHeight consistently - 9424
  • Fix - Core: IE6/7 return an empty string for getAttribute('id') when there is no ID attribute, rather than null. As such tables were not automatically being given an ID when they didn't have one, which created a situation where the settings object for a table could be 'lost' in IE6/7. Now check for empty string when checking the table ID.
  • Fix - Core: IE6/7 when scrolling is enabled could loose the sorting event due to the way cloned nodes work in those browsers. Note that this was introduced after 1.9.0. Related - jQuery bug 10437 -
  • Fix - Core: Language backwards compatibility could override developer defined defaults - 9267
  • Fix - Core: When -1 is selected for the display length (show all) the full numbers paging control didn't show page '1' - 9170
  • Fix - Core: afnSortData functions were not being executed with the DataTables instance's scope
  • Fix - Core: If sType for a column is html and the data is null, then _fnDataToSearch could throw an error - 8987
  • Fix - Core: Strip HTML from the aria-label tag for the sorting headers
  • Fix - Core: Use border collapse in JUI stylesheet - 8931
  • Fix - Core: The fnServerData error function can use the internal logging function now a days - make it do so - 8763
  • Fix - Core: The sStripeOdd / sStripeEven options for the class objects were not being applied to the table. The fix is to set the default for asStripeClasses to be null, and then if null is found there, then the user hasn't applied a default, nor have they overridden the default, therefore we can use the classes from the class objects - 8770.
  • Fix - Core: When scrolling is enabled the initial width of the header was being set to 150% which was a bit random and could result in the header flashing its display in the wrong place when loading. The fix is to use 100% unless x-scrolling is being forced, at which point it needs to match the inner table - 8332
  • Fix - Core: Feature match the server-side sorting to the client-side sorting for what information is sent to the server for sorting. Previously aDataSort was not honoured -!/naomiaro/status/172397914239414272
  • Fix - Core: When sorting non-string data as a string (type to type detection) then DataTables 1.9 would automatically convert the non-string data to an empty string so it can be sorted. This can result in unexpected ordering in the table. The fix is to check for a toString() function that is available for the data and if it is there, then use it (great for numeric data, dates etc), otherwise the empty string is used (null, methods without toString). This brings 1.9 back into line with how 1.8 behaved - 8549
  • Fix - Core: When updating the filtering input control, we would just match on INPUT elements, so if the developer had appended an input button to the filter wrapper, that value would also be changed - 8537. Now a reference to the input element is stored and used to update the input value (this method means we don't need to add another class option, and developers can change to 'type=search' if they wish).
  • Fix - Core: IE8 doesn't like the console check in logging - make it object based on window - 8517
  • Fix - Core: When scrolling the column matching would remove any nested THEAD and TFOOT elements in the table - 8423
  • Fix - Core: x-scrolling to the end of a table would cause the header and the columns to go out of alignment due to the header not being able to scroll as far as was needed (this was caused by the changes in 876a75f) - 8332.
  • Fix - Core: Table could continually expand when x-scrolling was enabled. This was partly addressed in 6776, but the fix was incomplete as it would still occur on Safari Mac (possibly other browsers as well). This fix is very closely related to 8332 (hence committing together as they are interdependent). Now use padding right on the header/footer wrapper to provide the overflow scroll ability, but only add it when a scrollbar is present - otherwise the width gets added on and we get the forever expanding table.
  • Fix - Core: Unit tests - New tests for scrolling to ensure 6776 and 8332 don't occur again
  • Fix - Core: When fnPreDrawCallback is used to cancel a draw the processing display would remain active - this should not be the case as DataTables is now finished with its processing - 8371
  • Fix - Core: asStripClasses if given was being overruled by the default given for asStripeClasses - 8332
  • Fix - Core: The extend function was only extending properties that existed on the original source object, not properties that only existed on the extender
  • Fix - Core: When using full numbers pagination in IE and clicking upon one of the numbers in the paging control, a Javascript error would occur due to trying to blur an element that was no longer in the DOM