diff --git a/.gitignore b/.gitignore
index 8c35a229..41ffacd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
extras
+docs
+.DS_Store
diff --git a/Readme.txt b/Readme.txt
index b56ab6ed..96a47cbd 100644
--- a/Readme.txt
+++ b/Readme.txt
@@ -1,4 +1,4 @@
-This DataTables plugin (v1.8.x) for jQuery was developed out of the desire to allow highly configurable access to HTML tables with advanced access features.
+This DataTables plugin (v1.9.x) for jQuery was developed out of the desire to allow highly configurable access to HTML tables with advanced access features.
For detailed installation, usage and API instructions, please refer to the DataTables web-pages: http://www.datatables.net
@@ -6,6 +6,6 @@ Questions, feature requests and bug reports (etc) can all be asked on the DataTa
The DataTables source can be found in the media/js/ directory of this archive.
-DataTables is released with dual licensing, using the GPL v2 (license-gpl2.txt) and an BSD style license (license-bsd.txt). Please see the corresponding license file for details of these licenses. You are free to use, modify and distribute this software, but all copyright information must remain.
+DataTables is released with dual licensing, using the GPL v2 (license-gpl2.txt) and an BSD style license (license-bsd.txt). You may select which of the two licenses you wish to use DataTables under. Please see the corresponding license file for details of these licenses. You are free to use, modify and distribute this software, but all copyright information must remain.
If you discover any bugs in DataTables, have any suggestions for improvements or even if you just like using it, please free to get in touch with me: www.datatables.net/contact
\ No newline at end of file
diff --git a/examples/advanced_init/column_render.html b/examples/advanced_init/column_render.html
index 5a302bb1..81175359 100644
--- a/examples/advanced_init/column_render.html
+++ b/examples/advanced_init/column_render.html
@@ -497,6 +497,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+ Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -515,7 +516,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -529,6 +530,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+ Setting defaults
API
diff --git a/examples/advanced_init/complex_header.html b/examples/advanced_init/complex_header.html
index 948de665..bf334e52 100644
--- a/examples/advanced_init/complex_header.html
+++ b/examples/advanced_init/complex_header.html
@@ -494,6 +494,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+ Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -512,7 +513,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -526,6 +527,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+ Setting defaults
API
diff --git a/examples/advanced_init/defaults.html b/examples/advanced_init/defaults.html
new file mode 100644
index 00000000..f8b7f8c4
--- /dev/null
+++ b/examples/advanced_init/defaults.html
@@ -0,0 +1,611 @@
+
+
+
+
+
+
+ DataTables example
+
+
+
+
+
+
+
+
+ DataTables - setting defaults example
+
+
+
Preamble
+
When working with DataTables over multiple pages it is often useful to set the initialisation defaults to common values (for example you might want to set sDom to a common value so all tables get the same layout). This can be done using the $.fn.dataTable.defaults object. This object will take all the same parameters as the DataTables initialisation object, but in this case you are setting the default for all future initialisations of DataTables.
+
+
This example shows the filtering and sorting features of DataTables being disabled by default, which is reflected in the table when it is initialised, as can be seen below.
+
+
Live example
+
+
+
+
+ Rendering engine
+ Browser
+ Platform(s)
+ Engine version
+ CSS grade
+
+
+
+
+ Trident
+ Internet
+ Explorer 4.0
+ Win 95+
+ 4
+ X
+
+
+ Trident
+ Internet
+ Explorer 5.0
+ Win 95+
+ 5
+ C
+
+
+ Trident
+ Internet
+ Explorer 5.5
+ Win 95+
+ 5.5
+ A
+
+
+ Trident
+ Internet
+ Explorer 6
+ Win 98+
+ 6
+ A
+
+
+ Trident
+ Internet Explorer 7
+ Win XP SP2+
+ 7
+ A
+
+
+ Trident
+ AOL browser (AOL desktop)
+ Win XP
+ 6
+ A
+
+
+ Gecko
+ Firefox 1.0
+ Win 98+ / OSX.2+
+ 1.7
+ A
+
+
+ Gecko
+ Firefox 1.5
+ Win 98+ / OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Firefox 2.0
+ Win 98+ / OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Firefox 3.0
+ Win 2k+ / OSX.3+
+ 1.9
+ A
+
+
+ Gecko
+ Camino 1.0
+ OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Camino 1.5
+ OSX.3+
+ 1.8
+ A
+
+
+ Gecko
+ Netscape 7.2
+ Win 95+ / Mac OS 8.6-9.2
+ 1.7
+ A
+
+
+ Gecko
+ Netscape Browser 8
+ Win 98SE+
+ 1.7
+ A
+
+
+ Gecko
+ Netscape Navigator 9
+ Win 98+ / OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Mozilla 1.0
+ Win 95+ / OSX.1+
+ 1
+ A
+
+
+ Gecko
+ Mozilla 1.1
+ Win 95+ / OSX.1+
+ 1.1
+ A
+
+
+ Gecko
+ Mozilla 1.2
+ Win 95+ / OSX.1+
+ 1.2
+ A
+
+
+ Gecko
+ Mozilla 1.3
+ Win 95+ / OSX.1+
+ 1.3
+ A
+
+
+ Gecko
+ Mozilla 1.4
+ Win 95+ / OSX.1+
+ 1.4
+ A
+
+
+ Gecko
+ Mozilla 1.5
+ Win 95+ / OSX.1+
+ 1.5
+ A
+
+
+ Gecko
+ Mozilla 1.6
+ Win 95+ / OSX.1+
+ 1.6
+ A
+
+
+ Gecko
+ Mozilla 1.7
+ Win 98+ / OSX.1+
+ 1.7
+ A
+
+
+ Gecko
+ Mozilla 1.8
+ Win 98+ / OSX.1+
+ 1.8
+ A
+
+
+ Gecko
+ Seamonkey 1.1
+ Win 98+ / OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Epiphany 2.20
+ Gnome
+ 1.8
+ A
+
+
+ Webkit
+ Safari 1.2
+ OSX.3
+ 125.5
+ A
+
+
+ Webkit
+ Safari 1.3
+ OSX.3
+ 312.8
+ A
+
+
+ Webkit
+ Safari 2.0
+ OSX.4+
+ 419.3
+ A
+
+
+ Webkit
+ Safari 3.0
+ OSX.4+
+ 522.1
+ A
+
+
+ Webkit
+ OmniWeb 5.5
+ OSX.4+
+ 420
+ A
+
+
+ Webkit
+ iPod Touch / iPhone
+ iPod
+ 420.1
+ A
+
+
+ Webkit
+ S60
+ S60
+ 413
+ A
+
+
+ Presto
+ Opera 7.0
+ Win 95+ / OSX.1+
+ -
+ A
+
+
+ Presto
+ Opera 7.5
+ Win 95+ / OSX.2+
+ -
+ A
+
+
+ Presto
+ Opera 8.0
+ Win 95+ / OSX.2+
+ -
+ A
+
+
+ Presto
+ Opera 8.5
+ Win 95+ / OSX.2+
+ -
+ A
+
+
+ Presto
+ Opera 9.0
+ Win 95+ / OSX.3+
+ -
+ A
+
+
+ Presto
+ Opera 9.2
+ Win 88+ / OSX.3+
+ -
+ A
+
+
+ Presto
+ Opera 9.5
+ Win 88+ / OSX.3+
+ -
+ A
+
+
+ Presto
+ Opera for Wii
+ Wii
+ -
+ A
+
+
+ Presto
+ Nokia N800
+ N800
+ -
+ A
+
+
+ Presto
+ Nintendo DS browser
+ Nintendo DS
+ 8.5
+ C/A1
+
+
+ KHTML
+ Konqureror 3.1
+ KDE 3.1
+ 3.1
+ C
+
+
+ KHTML
+ Konqureror 3.3
+ KDE 3.3
+ 3.3
+ A
+
+
+ KHTML
+ Konqureror 3.5
+ KDE 3.5
+ 3.5
+ A
+
+
+ Tasman
+ Internet Explorer 4.5
+ Mac OS 8-9
+ -
+ X
+
+
+ Tasman
+ Internet Explorer 5.1
+ Mac OS 7.6-9
+ 1
+ C
+
+
+ Tasman
+ Internet Explorer 5.2
+ Mac OS 8-X
+ 1
+ C
+
+
+ Misc
+ NetFront 3.1
+ Embedded devices
+ -
+ C
+
+
+ Misc
+ NetFront 3.4
+ Embedded devices
+ -
+ A
+
+
+ Misc
+ Dillo 0.8
+ Embedded devices
+ -
+ X
+
+
+ Misc
+ Links
+ Text only
+ -
+ X
+
+
+ Misc
+ Lynx
+ Text only
+ -
+ X
+
+
+ Misc
+ IE Mobile
+ Windows Mobile 6
+ -
+ C
+
+
+ Misc
+ PSP browser
+ PSP
+ -
+ C
+
+
+ Other browsers
+ All others
+ -
+ -
+ U
+
+
+
+
+ Rendering engine
+ Browser
+ Platform(s)
+ Engine version
+ CSS grade
+
+
+
+
+
+
+
+
Initialisation code
+
$(document).ready(function() {
+ $.extend( $.fn.dataTable.defaults, {
+ "bFilter": false,
+ "bSort": false
+ } );
+
+ $('#example').dataTable();
+} );
+
+
+
+
+
Other examples
+
+
Basic initialisation
+
+
+
Advanced initialisation
+
+
+
API
+
+
+
+
+
Data sources
+
+
+
Server-side processing
+
+
+
Ajax data source
+
+
+
Plug-ins
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/advanced_init/dom_multiple_elements.html b/examples/advanced_init/dom_multiple_elements.html
index 4677fc84..46f28d13 100644
--- a/examples/advanced_init/dom_multiple_elements.html
+++ b/examples/advanced_init/dom_multiple_elements.html
@@ -490,6 +490,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+ Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -508,7 +509,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -522,6 +523,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+ Setting defaults
API
diff --git a/examples/advanced_init/dom_toolbar.html b/examples/advanced_init/dom_toolbar.html
index 3bb53a02..25ff6d98 100644
--- a/examples/advanced_init/dom_toolbar.html
+++ b/examples/advanced_init/dom_toolbar.html
@@ -495,6 +495,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+ Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -513,7 +514,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -527,6 +528,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+ Setting defaults
API
diff --git a/examples/advanced_init/events_live.html b/examples/advanced_init/events_live.html
index bab4ed83..92ea85c9 100644
--- a/examples/advanced_init/events_live.html
+++ b/examples/advanced_init/events_live.html
@@ -523,6 +523,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+ Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -541,7 +542,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -555,6 +556,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+ Setting defaults
API
diff --git a/examples/advanced_init/events_post_init.html b/examples/advanced_init/events_post_init.html
index 5c4c7507..41ad2a68 100644
--- a/examples/advanced_init/events_post_init.html
+++ b/examples/advanced_init/events_post_init.html
@@ -42,7 +42,7 @@
var oTable = $('#example').dataTable();
/* Apply the tooltips */
- $( oTable.fnGetNodes() ).tooltip( {
+ oTable.$('tr').tooltip( {
"delay": 0,
"track": true,
"fade": 250
@@ -57,7 +57,8 @@
Preamble
- Events which are assigned to the table elements are retained by DataTables such that they will still work as you would expect, even after changing the sort order etc. (no need to reapply the event handlers). You can do this at any time, although if you apply the handlers after the table has been initialised there is an extra set. Rather then queriing the DOM to get all rows (since they aren't there) you need to use the fnGetNodes() API function. This is shown in this example.
+ Events which are assigned to the table elements are retained by DataTables such that they will still work as you would expect, even after changing the sort order etc. (no need to reapply the event handlers). You can do this at any time, although if you apply the handlers after the table has been initialised there is an extra set. Rather then querying the DOM to get all rows (since they aren't there) you can use the '$' API method that DataTables provides which does a jQuery selector on the whole table and returns a jQuery object.
+ This example shows the tooltip plug-in being applied to the table after initialisation.
Live example
@@ -521,7 +522,7 @@
var oTable = $('#example').dataTable();
/* Apply the tooltips */
- $( oTable.fnGetNodes() ).tooltip( {
+ oTable.$('tr').tooltip( {
"delay": 0,
"track": true,
"fade": 250
@@ -545,6 +546,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -563,7 +565,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -577,6 +579,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/advanced_init/events_pre_init.html b/examples/advanced_init/events_pre_init.html
index e364c449..a60ccc40 100644
--- a/examples/advanced_init/events_pre_init.html
+++ b/examples/advanced_init/events_pre_init.html
@@ -545,6 +545,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -563,7 +564,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -577,6 +578,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/advanced_init/footer_callback.html b/examples/advanced_init/footer_callback.html
index 3c88d79b..d9f66771 100644
--- a/examples/advanced_init/footer_callback.html
+++ b/examples/advanced_init/footer_callback.html
@@ -529,6 +529,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -547,7 +548,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -561,6 +562,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/advanced_init/highlight.html b/examples/advanced_init/highlight.html
index 6b76568e..51d513ca 100644
--- a/examples/advanced_init/highlight.html
+++ b/examples/advanced_init/highlight.html
@@ -522,6 +522,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -540,7 +541,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -554,6 +555,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/advanced_init/html_sort.html b/examples/advanced_init/html_sort.html
index 37e94c39..8281309a 100644
--- a/examples/advanced_init/html_sort.html
+++ b/examples/advanced_init/html_sort.html
@@ -76,6 +76,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -94,7 +95,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -108,6 +109,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/advanced_init/language_file.html b/examples/advanced_init/language_file.html
index 71ab546f..c737b883 100644
--- a/examples/advanced_init/language_file.html
+++ b/examples/advanced_init/language_file.html
@@ -487,6 +487,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -505,7 +506,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -519,6 +520,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/advanced_init/length_menu.html b/examples/advanced_init/length_menu.html
index 0c0ffb3b..d1cce32b 100644
--- a/examples/advanced_init/length_menu.html
+++ b/examples/advanced_init/length_menu.html
@@ -483,6 +483,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -501,7 +502,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -515,6 +516,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/advanced_init/row_callback.html b/examples/advanced_init/row_callback.html
index 20722a3c..9d4a4785 100644
--- a/examples/advanced_init/row_callback.html
+++ b/examples/advanced_init/row_callback.html
@@ -505,6 +505,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -523,7 +524,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -537,6 +538,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/advanced_init/row_grouping.html b/examples/advanced_init/row_grouping.html
index c235aeab..3099a816 100644
--- a/examples/advanced_init/row_grouping.html
+++ b/examples/advanced_init/row_grouping.html
@@ -540,6 +540,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -558,7 +559,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -572,6 +573,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/advanced_init/sorting_control.html b/examples/advanced_init/sorting_control.html
index 15f9808b..d01818d0 100644
--- a/examples/advanced_init/sorting_control.html
+++ b/examples/advanced_init/sorting_control.html
@@ -504,6 +504,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -522,7 +523,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -536,6 +537,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/ajax/ajax.html b/examples/ajax/ajax.html
index f85bf230..65a48f31 100644
--- a/examples/ajax/ajax.html
+++ b/examples/ajax/ajax.html
@@ -87,6 +87,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -105,7 +106,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -119,6 +120,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/ajax/custom_data_property.html b/examples/ajax/custom_data_property.html
index d8bc20c1..bf0fe1b1 100644
--- a/examples/ajax/custom_data_property.html
+++ b/examples/ajax/custom_data_property.html
@@ -89,6 +89,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -107,7 +108,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -121,6 +122,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/ajax/deep.html b/examples/ajax/deep.html
index 842160c3..af43013b 100644
--- a/examples/ajax/deep.html
+++ b/examples/ajax/deep.html
@@ -101,6 +101,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -119,7 +120,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -133,6 +134,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/ajax/defer_render.html b/examples/ajax/defer_render.html
index 16bdbdb3..f38558b3 100644
--- a/examples/ajax/defer_render.html
+++ b/examples/ajax/defer_render.html
@@ -89,6 +89,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -107,7 +108,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -121,6 +122,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/ajax/null_data_source.html b/examples/ajax/null_data_source.html
index 116bdd3a..9e510cca 100644
--- a/examples/ajax/null_data_source.html
+++ b/examples/ajax/null_data_source.html
@@ -93,6 +93,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -111,7 +112,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -125,6 +126,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/ajax/objects.html b/examples/ajax/objects.html
index 2868b8d2..cbfb4fd0 100644
--- a/examples/ajax/objects.html
+++ b/examples/ajax/objects.html
@@ -101,6 +101,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -119,7 +120,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -133,6 +134,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/ajax/objects_subarrays.html b/examples/ajax/objects_subarrays.html
index 49b2b93f..1547c096 100644
--- a/examples/ajax/objects_subarrays.html
+++ b/examples/ajax/objects_subarrays.html
@@ -101,6 +101,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -119,7 +120,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -133,6 +134,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/api/add_row.html b/examples/api/add_row.html
index 987b630b..13b4bbf2 100644
--- a/examples/api/add_row.html
+++ b/examples/api/add_row.html
@@ -100,6 +100,7 @@ function fnClickAddRow() {
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -118,7 +119,7 @@ function fnClickAddRow() {
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -132,6 +133,7 @@ function fnClickAddRow() {
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/api/api_in_init.html b/examples/api/api_in_init.html
index cb558a8d..e1beb086 100644
--- a/examples/api/api_in_init.html
+++ b/examples/api/api_in_init.html
@@ -15,10 +15,8 @@
$(document).ready(function() {
$('#example').dataTable( {
"fnInitComplete": function () {
- var
- that = this,
- nTrs = this.fnGetNodes();
- $('td', nTrs).click( function () {
+ var that = this;
+ this.$('td').click( function () {
that.fnFilter( this.innerHTML );
} );
}
@@ -33,8 +31,8 @@
Preamble
- There are times when you may wish to call API functions inside the DataTables callback functions (for example fnInitComplete, fnRowCallback etc). The complicating issue with this is that the object hasn't fully initialised, so you can't assign the result to something like oTable and then use oTable in the callback. However, this is catered for by the execution scope of the callback function. Here 'this' is the DataTables object that is created for the table.
- In this example you will be able to see that this.fnGetNodes() is used, and also the value of this stored in the variable 'that' so it can be used inside the jQuery click function, where the execution scope has been changed to the td element!). The action here is to apply the filter with the value of what is in each cell.
+ There are times when you may wish to call API functions inside the DataTables callback functions (for example fnInitComplete, fnRowCallback etc). The complicating issue with this is that the object hasn't fully initialised, so you can't assign the result to something like oTable and then use oTable in the callback. However, this is catered for by the execution scope of the callback function. Here this is the DataTables object that is created for the table.
+ In this example you will be able to see that this.$() is used to get all nodes in the table's body and then act on them (in this case added a click event). Note also the value of this stored in the variable that so it can be used inside the jQuery click function, where the execution scope has been changed to the td element!). The action here is to apply the filter with the value of what is in each cell.
Live example
@@ -471,10 +469,8 @@
$(document).ready(function() {
$('#example').dataTable( {
"fnInitComplete": function () {
- var
- that = this,
- nTrs = this.fnGetNodes();
- $('td', nTrs).click( function () {
+ var that = this;
+ this.$('td').click( function () {
that.fnFilter( this.innerHTML );
} );
}
@@ -498,6 +494,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -516,7 +513,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -530,6 +527,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/api/counter_column.html b/examples/api/counter_column.html
index 2117ed94..663d5f8a 100644
--- a/examples/api/counter_column.html
+++ b/examples/api/counter_column.html
@@ -569,6 +569,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -587,7 +588,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -601,6 +602,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/api/editable.html b/examples/api/editable.html
index fd75f47e..df171637 100644
--- a/examples/api/editable.html
+++ b/examples/api/editable.html
@@ -18,7 +18,7 @@
var oTable = $('#example').dataTable();
/* Apply the jEditable handlers to the table */
- $('td', oTable.fnGetNodes()).editable( '../examples_support/editable_ajax.php', {
+ oTable.$('td').editable( '../examples_support/editable_ajax.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
@@ -484,7 +484,7 @@
var oTable = $('#example').dataTable();
/* Apply the jEditable handlers to the table */
- $('td', oTable.fnGetNodes()).editable( '../examples_support/editable_ajax.php', {
+ oTable.$('td').editable( '../examples_support/editable_ajax.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
@@ -516,6 +516,7 @@
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -534,7 +535,7 @@
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -548,6 +549,7 @@
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/api/form.html b/examples/api/form.html
index d79c7923..76ca4556 100644
--- a/examples/api/form.html
+++ b/examples/api/form.html
@@ -16,7 +16,7 @@
$(document).ready(function() {
$('#form').submit( function() {
- var sData = $('input', oTable.fnGetNodes()).serialize();
+ var sData = oTable.$('input').serialize();
alert( "The following data would have been submitted to the server: \n\n"+sData );
return false;
} );
@@ -534,7 +534,7 @@
$(document).ready(function() {
$('#form').submit( function() {
- var sData = $('input', oTable.fnGetNodes()).serialize();
+ var sData = oTable.$('input').serialize();
alert( "The following data would have been submitted to the server: \n\n"+sData );
return false;
} );
@@ -559,6 +559,7 @@ $(document).ready(function() {
Hidden columns
Complex headers - grouping with colspan
DOM positioning
+
Flexible table width
State saving
Alternative pagination styles
Scrolling:
@@ -577,7 +578,7 @@ $(document).ready(function() {
Events:
Live events /
Pre-init /
- Post-init with fnGetNodes
+ Post-init
Column rendering
Sorting without HTML tags
@@ -591,6 +592,7 @@ $(document).ready(function() {
Footer callback
Control sorting direction of columns
Change language information from a file (internationalisation)
+
Setting defaults
API
diff --git a/examples/api/highlight.html b/examples/api/highlight.html
index ff312d96..74fac84c 100644
--- a/examples/api/highlight.html
+++ b/examples/api/highlight.html
@@ -17,12 +17,11 @@
"bSortClasses": false
} );
- $('td', oTable.fnGetNodes()).hover( function() {
+ oTable.$('td').hover( function() {
var iCol = $('td', this.parentNode).index(this) % 5;
- var nTrs = oTable.fnGetNodes();
- $('td:nth-child('+(iCol+1)+')', nTrs).addClass( 'highlighted' );
+ $('td:nth-child('+(iCol+1)+')', oTable.$('tr')).addClass( 'highlighted' );
}, function() {
- $('td.highlighted', oTable.fnGetNodes()).removeClass('highlighted');
+ oTable.$('td.highlighted').removeClass('highlighted');
} );
} );
@@ -473,12 +472,11 @@
"bSortClasses": false
} );
- $('td', oTable.fnGetNodes()).hover( function() {
+ oTable.$('td').hover( function() {
var iCol = $('td', this.parentNode).index(this) % 5;
- var nTrs = oTable.fnGetNodes();
- $('td:nth-child('+(iCol+1)+')', nTrs).addClass( 'highlighted' );
+ $('td:nth-child('+(iCol+1)+')', oTable.$('tr')).addClass( 'highlighted' );
}, function() {
- $('td.highlighted', oTable.fnGetNodes()).removeClass('highlighted');
+ oTable.$('td.highlighted').removeClass('highlighted');
} );
} );
+
+
+
+
+
+
+
+ DataTables - flexible width example
+
+
+
Preamble
+
Often you may want to have your table resize dynamically with the page. Typically this is done by assigning width:100% in your CSS, but this presents a problem for Javascript since it can be very hard to get that relative size, rather than the absolute pixels. As such, if you apply the width attribute to the HTML table
+ tag, this will be used as the width for the table (overruling any CSS styles).
+
This example shows a table width width="100%" and the container is also flexible width, so as the window is resized, the table will also resize dynamically.
+
+
Live example
+
+
+
+
+ Rendering engine
+ Browser
+ Platform(s)
+ Engine version
+ CSS grade
+
+
+
+
+ Trident
+ Internet
+ Explorer 4.0
+ Win 95+
+ 4
+ X
+
+
+ Trident
+ Internet
+ Explorer 5.0
+ Win 95+
+ 5
+ C
+
+
+ Trident
+ Internet
+ Explorer 5.5
+ Win 95+
+ 5.5
+ A
+
+
+ Trident
+ Internet
+ Explorer 6
+ Win 98+
+ 6
+ A
+
+
+ Trident
+ Internet Explorer 7
+ Win XP SP2+
+ 7
+ A
+
+
+ Trident
+ AOL browser (AOL desktop)
+ Win XP
+ 6
+ A
+
+
+ Gecko
+ Firefox 1.0
+ Win 98+ / OSX.2+
+ 1.7
+ A
+
+
+ Gecko
+ Firefox 1.5
+ Win 98+ / OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Firefox 2.0
+ Win 98+ / OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Firefox 3.0
+ Win 2k+ / OSX.3+
+ 1.9
+ A
+
+
+ Gecko
+ Camino 1.0
+ OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Camino 1.5
+ OSX.3+
+ 1.8
+ A
+
+
+ Gecko
+ Netscape 7.2
+ Win 95+ / Mac OS 8.6-9.2
+ 1.7
+ A
+
+
+ Gecko
+ Netscape Browser 8
+ Win 98SE+
+ 1.7
+ A
+
+
+ Gecko
+ Netscape Navigator 9
+ Win 98+ / OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Mozilla 1.0
+ Win 95+ / OSX.1+
+ 1
+ A
+
+
+ Gecko
+ Mozilla 1.1
+ Win 95+ / OSX.1+
+ 1.1
+ A
+
+
+ Gecko
+ Mozilla 1.2
+ Win 95+ / OSX.1+
+ 1.2
+ A
+
+
+ Gecko
+ Mozilla 1.3
+ Win 95+ / OSX.1+
+ 1.3
+ A
+
+
+ Gecko
+ Mozilla 1.4
+ Win 95+ / OSX.1+
+ 1.4
+ A
+
+
+ Gecko
+ Mozilla 1.5
+ Win 95+ / OSX.1+
+ 1.5
+ A
+
+
+ Gecko
+ Mozilla 1.6
+ Win 95+ / OSX.1+
+ 1.6
+ A
+
+
+ Gecko
+ Mozilla 1.7
+ Win 98+ / OSX.1+
+ 1.7
+ A
+
+
+ Gecko
+ Mozilla 1.8
+ Win 98+ / OSX.1+
+ 1.8
+ A
+
+
+ Gecko
+ Seamonkey 1.1
+ Win 98+ / OSX.2+
+ 1.8
+ A
+
+
+ Gecko
+ Epiphany 2.20
+ Gnome
+ 1.8
+ A
+
+
+ Webkit
+ Safari 1.2
+ OSX.3
+ 125.5
+ A
+
+
+ Webkit
+ Safari 1.3
+ OSX.3
+ 312.8
+ A
+
+
+ Webkit
+ Safari 2.0
+ OSX.4+
+ 419.3
+ A
+
+
+ Webkit
+ Safari 3.0
+ OSX.4+
+ 522.1
+ A
+
+
+ Webkit
+ OmniWeb 5.5
+ OSX.4+
+ 420
+ A
+
+
+ Webkit
+ iPod Touch / iPhone
+ iPod
+ 420.1
+ A
+
+
+ Webkit
+ S60
+ S60
+ 413
+ A
+
+
+ Presto
+ Opera 7.0
+ Win 95+ / OSX.1+
+ -
+ A
+
+
+ Presto
+ Opera 7.5
+ Win 95+ / OSX.2+
+ -
+ A
+
+
+ Presto
+ Opera 8.0
+ Win 95+ / OSX.2+
+ -
+ A
+
+
+ Presto
+ Opera 8.5
+ Win 95+ / OSX.2+
+ -
+ A
+
+
+ Presto
+ Opera 9.0
+ Win 95+ / OSX.3+
+ -
+ A
+
+
+ Presto
+ Opera 9.2
+ Win 88+ / OSX.3+
+ -
+ A
+
+
+ Presto
+ Opera 9.5
+ Win 88+ / OSX.3+
+ -
+ A
+
+
+ Presto
+ Opera for Wii
+ Wii
+ -
+ A
+
+
+ Presto
+ Nokia N800
+ N800
+ -
+ A
+
+
+ Presto
+ Nintendo DS browser
+ Nintendo DS
+ 8.5
+ C/A1
+
+
+ KHTML
+ Konqureror 3.1
+ KDE 3.1
+ 3.1
+ C
+
+
+ KHTML
+ Konqureror 3.3
+ KDE 3.3
+ 3.3
+ A
+
+
+ KHTML
+ Konqureror 3.5
+ KDE 3.5
+ 3.5
+ A
+
+
+ Tasman
+ Internet Explorer 4.5
+ Mac OS 8-9
+ -
+ X
+
+
+ Tasman
+ Internet Explorer 5.1
+ Mac OS 7.6-9
+ 1
+ C
+
+
+ Tasman
+ Internet Explorer 5.2
+ Mac OS 8-X
+ 1
+ C
+
+
+ Misc
+ NetFront 3.1
+ Embedded devices
+ -
+ C
+
+
+ Misc
+ NetFront 3.4
+ Embedded devices
+ -
+ A
+
+
+ Misc
+ Dillo 0.8
+ Embedded devices
+ -
+ X
+
+
+ Misc
+ Links
+ Text only
+ -
+ X
+
+
+ Misc
+ Lynx
+ Text only
+ -
+ X
+
+
+ Misc
+ IE Mobile
+ Windows Mobile 6
+ -
+ C
+
+
+ Misc
+ PSP browser
+ PSP
+ -
+ C
+
+
+ Other browsers
+ All others
+ -
+ -
+ U
+
+
+
+
+ Rendering engine
+ Browser
+ Platform(s)
+ Engine version
+ CSS grade
+
+
+
+
+
+
+
+
Initialisation code
+
$(document).ready(function() {
+ $('#example').dataTable();
+} );
+
+
+
+
+
Other examples
+
+
Basic initialisation
+
+
+
Advanced initialisation
+
+
+
API
+
+
+
+
+
Data sources
+
+
+
Server-side processing
+
+
+
Ajax data source
+
+
+
Plug-ins
+
+
+
+
+
+
+
+