annotate DataTables-1.9.4/docs/DataTable.models.ext.html @ 3:4a6ebda2a3ae draft

fixed tool dependency issue
author saskia-hiltemann
date Tue, 30 Sep 2014 09:56:12 -0400
parents ac5f9272033b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 <html>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3 <head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 <meta http-equiv="Content-type" content="text/html; charset=utf-8">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 <title>Namespace: ext - documentation</title>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 <style type="text/css" media="screen">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 @import "media/css/doc.css";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 @import "media/css/shCore.css";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 @import "media/css/shThemeDataTables.css";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11 </style>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 <script type="text/javascript" src="media/js/shCore.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 <script type="text/javascript" src="media/js/shBrushJScript.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 <script type="text/javascript" src="media/js/jquery.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 <script type="text/javascript" src="media/js/doc.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 </head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 <body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 <div class="fw_container">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 <a name="top"></a>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 <div class="fw_header">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 <h1 class="page-title">Namespace: ext</h1>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 <h2 class="ancestors">Ancestry: <span class="ancestors"><a href="DataTable.html">DataTable</a> » <a href="DataTable.models.html">.models</a>.</span> » ext</h2>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 <div class="page-info">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 DataTables v1.9.4 documentation
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 <div class="fw_nav">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 <h2>Navigation</h2>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 <li><a href="#top">Overview</a></li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 <li><a href="#summary">Summary</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Classes (0)</td><td>Namespaces (0)</td></tr><tr><td>Properties (0)</td><td><a href="#summary_properties_static">Static properties (14)</a></td></tr><tr><td>Methods (0)</td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li><li><a href="#details">Details</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Properties (0)</td><td><a href="#summary_properties_static">Static properties (14)</a></td></tr><tr><td>Methods (0)</td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li></ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 <div style="margin-top: 10px;">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 <input type="hidden" name="show_private" value="0">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 <span id="private_label">Hiding</span> private elements
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 (<a id="private_toggle" href="">toggle</a>)
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 </span>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 <div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 <input type="hidden" name="show_extended" value="1">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 <span id="extended_label">Showing</span> extended elements
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 (<a id="extended_toggle" href="">toggle</a>)
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 </span>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 <div class="fw_content">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 <a name="overview"></a>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 <div class="doc_overview">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 <div class="nav_blocker"></div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 <p>DataTables extension options and plug-ins. This namespace acts as a collection "area"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 for plug-ins that can be used to extend the default DataTables behaviour - indeed many
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 of the build in methods use this method to provide their own capabilities (sorting methods
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 for example).</p>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 <p>Note that this namespace is aliased to jQuery.fn.dataTableExt so it can be readily accessed
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 and modified by plug-ins.</p><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68 <div class="doc_summary">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 <a name="summary"></a>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 <h2>Summary</h2>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72 <div class="doc_group"><a name="summary_properties_static"></a><h3 class="subsection-title">Properties - static</h3>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 <dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 <dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#afnFiltering">afnFiltering</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>Plug-in filtering functions - this method of filtering is complimentary to the default
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76 type based filtering, and a lot more comprehensive as it allows you complete control
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 over the filtering logic. Each element in this array is a function (parameters
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78 described below) that is called for every row in the table, and your logic decides if
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79 it should be included in the filtered data set or not.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
80 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
83 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
84 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
85 <li>{array|object} Data for the row to be processed (same as the original format
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
86 that was passed in as the data source, or an array from a DOM data source</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
87 <li>{int} Row index in aoData (<a href="DataTable.models.oSettings.html#aoData">DataTable.models.oSettings.aoData</a>), which can
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
88 be useful to retrieve the TR element if you need DOM interaction.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
89 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
90 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
91 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
92 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
93 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
94 <li>{boolean} Include the row in the filtered result set (true) or not (false)</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
95 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
96 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
97 </ul></p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#afnSortData">afnSortData</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>Plug-in sorting functions - this method of sorting is complimentary to the default type
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
98 based sorting that DataTables does automatically, allowing much greater control over the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
99 the data that is being used to sort a column. This is useful if you want to do sorting
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
100 based on live data (for example the contents of an 'input' element) rather than just the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
101 static string that DataTables knows of. The way these plug-ins work is that you create
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
102 an array of the values you wish to be sorted for the column in question and then return
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
103 that array. Which pre-sorting function is run here depends on the sSortDataType parameter
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
104 that is used for the column (if any). This is the corollary of <i>ofnSearch</i> for sort
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
105 data.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
106 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
107 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
108 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
109 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
110 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
111 <li>{int} Target column index</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
112 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
113 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
114 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
115 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
116 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
117 <li>{array} Data for the column to be sorted upon</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
118 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
119 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
120 </ul> [<a href-"#afnSortData">...</a>] </p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#aoFeatures">aoFeatures</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>Feature plug-ins - This is an array of objects which describe the feature plug-ins that are
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
121 available to DataTables. These feature plug-ins are accessible through the sDom initialisation
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
122 option. As such, each feature plug-in must describe a function that is used to initialise
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
123 itself (fnInit), a character so the feature can be enabled by sDom (cFeature) and the name
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
124 of the feature (sFeature). Thus the objects attached to this method must provide:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
125 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
126 <li>{function} fnInit Initialisation of the plug-in
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
127 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
128 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
129 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
130 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
131 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
132 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
133 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
134 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
135 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
136 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
137 <li>{node|null} The element which contains your feature. Note that the return
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
138 may also be void if your plug-in does not require to inject any DOM elements
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
139 into DataTables control (sDom) - for example this might be useful when
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
140 developing a plug-in which allows table control via keyboard entry.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
141 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
142 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
143 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
144 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
145 <li>{character} cFeature Character that will be matched in sDom - case sensitive</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
146 <li>{string} sFeature Feature name</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
147 </ul></p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#aTypes">aTypes</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>Type detection plug-in functions - DataTables utilises types to define how sorting and
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
148 filtering behave, and types can be either be defined by the developer (sType for the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
149 column) or they can be automatically detected by the methods in this array. The functions
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
150 defined in the array are quite simple, taking a single parameter (the data to analyse)
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
151 and returning the type if it is a known type, or null otherwise.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
152 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
153 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
154 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
155 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
156 <li>{*} Data from the column cell to be analysed</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
157 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
158 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
159 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
160 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
161 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
162 <li>{string|null} Data type detected, or null if unknown (and thus pass it
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
163 on to the other type detection functions.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
164 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
165 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
166 </ul></p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#fnVersionCheck">fnVersionCheck</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>Provide a common method for plug-ins to check the version of DataTables being used,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
167 in order to ensure compatibility.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#iApiIndex">iApiIndex</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Index for what 'this' index API functions should use</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oApi">oApi</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" even"><p>Container for all private functions in DataTables so they can be exposed externally</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#ofnSearch">ofnSearch</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" odd"><p>Pre-processing of filtering data plug-ins - When you assign the sType for a column
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
168 (or have it automatically detected for you by DataTables or a type detection plug-in),
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
169 you will typically be using this for custom sorting, but it can also be used to provide
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
170 custom filtering by allowing you to pre-processing the data and returning the data in
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
171 the format that should be filtered upon. This is done by adding functions this object
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
172 with a parameter name which matches the sType for that target column. This is the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
173 corollary of <i>afnSortData</i> for filtering data.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
174 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
175 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
176 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
177 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
178 <li>{*} Data from the column cell to be prepared for filtering</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
179 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
180 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
181 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
182 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
183 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
184 <li>{string|null} Formatted string that will be used for the filtering.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
185 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
186 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
187 </ul> [<a href-"#ofnSearch">...</a>] </p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oJUIClasses">oJUIClasses</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" even"><p>Storage for the various classes that DataTables uses - jQuery UI suitable</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oPagination">oPagination</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" odd"><p>Pagination plug-in methods - The style and controls of the pagination can significantly
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
188 impact on how the end user interacts with the data in your table, and DataTables allows
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
189 the addition of pagination controls by extending this object, which can then be enabled
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
190 through the <i>sPaginationType</i> initialisation parameter. Each pagination type that
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
191 is added is an object (the property name of which is what <i>sPaginationType</i> refers
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
192 to) that has two properties, both methods that are used by DataTables to update the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
193 control's state.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
194 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
195 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
196 fnInit - Initialisation of the paging controls. Called only during initialisation
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
197 of the table. It is expected that this function will add the required DOM elements
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
198 to the page for the paging controls to work. The element pointer
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
199 'oSettings.aanFeatures.p' array is provided by DataTables to contain the paging
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
200 controls (note that this is a 2D array to allow for multiple instances of each
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
201 DataTables DOM element). It is suggested that you add the controls to this element
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
202 as children
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
203 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
204 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
205 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
206 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
207 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
208 <li>{node} Container into which the pagination controls must be inserted</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
209 <li>{function} Draw callback function - whenever the controls cause a page
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
210 change, this method must be called to redraw the table.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
211 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
212 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
213 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
214 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
215 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
216 <li>No return required</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
217 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
218 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
219 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
220 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
221 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
222 fnInit - This function is called whenever the paging status of the table changes and is
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
223 typically used to update classes and/or text of the paging controls to reflex the new
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
224 status.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
225 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
226 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
227 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
228 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
229 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
230 <li>{function} Draw callback function - in case you need to redraw the table again
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
231 or attach new event listeners</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
232 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
233 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
234 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
235 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
236 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
237 <li>No return required</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
238 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
239 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
240 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
241 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
242 </ul></p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oSort">oSort</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" even"><p>Sorting plug-in methods - Sorting in DataTables is based on the detected type of the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
243 data column (you can add your own type detection functions, or override automatic
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
244 detection using sType). With this specific type given to the column, DataTables will
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
245 apply the required sort from the functions in the object. Each sort type must provide
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
246 two mandatory methods, one each for ascending and descending sorting, and can optionally
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
247 provide a pre-formatting method that will help speed up sorting by allowing DataTables
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
248 to pre-format the sort data only once (rather than every time the actual sort functions
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
249 are run). The two sorting functions are typical Javascript sort methods:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
250 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
251 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
252 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
253 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
254 <li>{<em>} Data to compare to the second parameter</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
255 <li>{</em>} Data to compare to the first parameter</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
256 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
257 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
258 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
259 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
260 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
261 <li>{int} Sorting match: &lt;0 if first parameter should be sorted lower than
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
262 the second parameter, ===0 if the two parameters are equal and >0 if
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
263 the first parameter should be sorted height than the second parameter.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
264 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
265 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
266 </ul></p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oStdClasses">oStdClasses</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" odd"><p>Storage for the various classes that DataTables uses</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#sErrMode">sErrMode</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>How should DataTables report an error. Can take the value 'alert' or 'throw'</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#sVersion">sVersion</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>Version string for plug-ins to check compatibility. Allowed format is
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
267 a.b.c.d.e where: a:int, b:int, c:int, d:string(dev|beta), e:int. d and
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
268 e are optional</p></dd>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
269 </dl></div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
270 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
271
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
272
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
273
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
274
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
275 <div class="doc_details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
276 <a name="details"></a>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
277 <h2>Details</h2>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
278 <div class="doc_group"><a name="details_properties"></a><h3 class="subsection-title">Properties - static</h3>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
279 <dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
280 <dt class=" even"><a name="afnFiltering"></a><a name="afnFiltering_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#afnFiltering">afnFiltering</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>Plug-in filtering functions - this method of filtering is complimentary to the default
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
281 type based filtering, and a lot more comprehensive as it allows you complete control
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
282 over the filtering logic. Each element in this array is a function (parameters
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
283 described below) that is called for every row in the table, and your logic decides if
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
284 it should be included in the filtered data set or not.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
285 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
286 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
287 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
288 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
289 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
290 <li>{array|object} Data for the row to be processed (same as the original format
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
291 that was passed in as the data source, or an array from a DOM data source</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
292 <li>{int} Row index in aoData (<a href="DataTable.models.oSettings.html#aoData">DataTable.models.oSettings.aoData</a>), which can
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
293 be useful to retrieve the TR element if you need DOM interaction.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
294 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
295 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
296 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
297 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
298 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
299 <li>{boolean} Include the row in the filtered result set (true) or not (false)</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
300 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
301 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
302 </ul></p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
303
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
304 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
305 <h5>Example</h5>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
306 <div class="example-code">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
307 <pre class="brush: js"> // The following example shows custom filtering being applied to the fourth column (i.e.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
308 // the aData[3] index) based on two input values from the end-user, matching the data in
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
309 // a certain range.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
310 $.fn.dataTableExt.afnFiltering.push(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
311 function( oSettings, aData, iDataIndex ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
312 var iMin = document.getElementById('min').value * 1;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
313 var iMax = document.getElementById('max').value * 1;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
314 var iVersion = aData[3] == "-" ? 0 : aData[3]*1;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
315 if ( iMin == "" && iMax == "" ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
316 return true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
317 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
318 else if ( iMin == "" && iVersion < iMax ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
319 return true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
320 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
321 else if ( iMin < iVersion && "" == iMax ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
322 return true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
323 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
324 else if ( iMin < iVersion && iVersion < iMax ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
325 return true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
326 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
327 return false;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
328 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
329 );</pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
330 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
331 </div></dd><dt class=" odd"><a name="afnSortData"></a><a name="afnSortData_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#afnSortData">afnSortData</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>Plug-in sorting functions - this method of sorting is complimentary to the default type
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
332 based sorting that DataTables does automatically, allowing much greater control over the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
333 the data that is being used to sort a column. This is useful if you want to do sorting
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
334 based on live data (for example the contents of an 'input' element) rather than just the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
335 static string that DataTables knows of. The way these plug-ins work is that you create
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
336 an array of the values you wish to be sorted for the column in question and then return
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
337 that array. Which pre-sorting function is run here depends on the sSortDataType parameter
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
338 that is used for the column (if any). This is the corollary of <i>ofnSearch</i> for sort
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
339 data.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
340 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
341 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
342 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
343 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
344 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
345 <li>{int} Target column index</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
346 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
347 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
348 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
349 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
350 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
351 <li>{array} Data for the column to be sorted upon</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
352 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
353 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
354 </ul></p>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
355
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
356 <p>Note that as of v1.9, it is typically preferable to use <i>mData</i> to prepare data for
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
357 the different uses that DataTables can put the data to. Specifically <i>mData</i> when
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
358 used as a function will give you a 'type' (sorting, filtering etc) that you can use to
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
359 prepare the data as required for the different types. As such, this method is deprecated.</p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
360 <dt class="important">Deprecated</dt><dd class="yes-def">Yes</dd>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
361 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
362 <h5>Example</h5>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
363 <div class="example-code">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
364 <pre class="brush: js"> // Updating the cached sorting information with user entered values in HTML input elements
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
365 jQuery.fn.dataTableExt.afnSortData['dom-text'] = function ( oSettings, iColumn )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
366 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
367 var aData = [];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
368 $( 'td:eq('+iColumn+') input', oSettings.oApi._fnGetTrNodes(oSettings) ).each( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
369 aData.push( this.value );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
370 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
371 return aData;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
372 }</pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
373 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
374 </div></dd><dt class=" even"><a name="aoFeatures"></a><a name="aoFeatures_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#aoFeatures">aoFeatures</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>Feature plug-ins - This is an array of objects which describe the feature plug-ins that are
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
375 available to DataTables. These feature plug-ins are accessible through the sDom initialisation
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
376 option. As such, each feature plug-in must describe a function that is used to initialise
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
377 itself (fnInit), a character so the feature can be enabled by sDom (cFeature) and the name
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
378 of the feature (sFeature). Thus the objects attached to this method must provide:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
379 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
380 <li>{function} fnInit Initialisation of the plug-in
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
381 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
382 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
383 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
384 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
385 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
386 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
387 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
388 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
389 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
390 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
391 <li>{node|null} The element which contains your feature. Note that the return
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
392 may also be void if your plug-in does not require to inject any DOM elements
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
393 into DataTables control (sDom) - for example this might be useful when
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
394 developing a plug-in which allows table control via keyboard entry.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
395 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
396 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
397 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
398 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
399 <li>{character} cFeature Character that will be matched in sDom - case sensitive</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
400 <li>{string} sFeature Feature name</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
401 </ul></p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
402
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
403 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
404 <h5>Example</h5>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
405 <div class="example-code">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
406 <pre class="brush: js"> // How TableTools initialises itself.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
407 $.fn.dataTableExt.aoFeatures.push( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
408 "fnInit": function( oSettings ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
409 return new TableTools( { "oDTSettings": oSettings } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
410 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
411 "cFeature": "T",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
412 "sFeature": "TableTools"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
413 } );</pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
414 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
415 </div></dd><dt class=" odd"><a name="aTypes"></a><a name="aTypes_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#aTypes">aTypes</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>Type detection plug-in functions - DataTables utilises types to define how sorting and
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
416 filtering behave, and types can be either be defined by the developer (sType for the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
417 column) or they can be automatically detected by the methods in this array. The functions
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
418 defined in the array are quite simple, taking a single parameter (the data to analyse)
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
419 and returning the type if it is a known type, or null otherwise.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
420 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
421 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
422 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
423 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
424 <li>{*} Data from the column cell to be analysed</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
425 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
426 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
427 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
428 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
429 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
430 <li>{string|null} Data type detected, or null if unknown (and thus pass it
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
431 on to the other type detection functions.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
432 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
433 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
434 </ul></p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
435
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
436 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
437 <h5>Example</h5>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
438 <div class="example-code">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
439 <pre class="brush: js"> // Currency type detection plug-in:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
440 jQuery.fn.dataTableExt.aTypes.push(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
441 function ( sData ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
442 var sValidChars = "0123456789.-";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
443 var Char;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
444
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
445 // Check the numeric part
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
446 for ( i=1 ; i<sData.length ; i++ ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
447 Char = sData.charAt(i);
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
448 if (sValidChars.indexOf(Char) == -1) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
449 return null;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
450 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
451 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
452
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
453 // Check prefixed by currency
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
454 if ( sData.charAt(0) == '$' || sData.charAt(0) == '&pound;' ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
455 return 'currency';
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
456 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
457 return null;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
458 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
459 );</pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
460 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
461 </div></dd><dt id="DataTable.models.ext.fnVersionCheck" class=" even"><a name="fnVersionCheck"></a><a name="fnVersionCheck_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a>fnVersionCheck</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>Provide a common method for plug-ins to check the version of DataTables being used,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
462 in order to ensure compatibility.</p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
463
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
464 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
465 <h5>Parameters:</h5>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
466
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
467 <table class="params">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
468 <thead>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
469 <tr>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
470 <th width="20"></th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
471 <th width="12%" class="bottom_border name">Name</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
472 <th width="10%" class="bottom_border">Type</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
473 <th width="10%" class="bottom_border">Attributes</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
474 <th width="10%" class="bottom_border">Default</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
475 <th class="last bottom_border">Description</th>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
476 </tr>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
477 </thead>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
478
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
479 <tbody>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
480 <tr class="even"><td class="number right_border"><div>1</div></td><td class="name">sVersion</td><td class="type type-param">string</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Version string to check for, in the format "X.Y.Z". Note
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
481 that the formats "X" and "X.Y" are also acceptable.</p></td></tr>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
482 </tbody>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
483 </table><h5>Returns:</h5><p class="returns"><p>true if this version of DataTables is greater or equal to the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
484 required version, or false if this version of DataTales is not suitable</p></p><h5>Example:</h5>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
485 <div class="example-code">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
486 <pre class="brush: js"> $(document).ready(function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
487 var oTable = $('#example').dataTable();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
488 alert( oTable.fnVersionCheck( '1.9.0' ) );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
489 } );</pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
490 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
491 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
492 <dt class=" odd"><a name="iApiIndex"></a><a name="iApiIndex_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#iApiIndex">iApiIndex</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Index for what 'this' index API functions should use</p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
493
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
494 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
495 </div></dd><dt class=" even"><a name="oApi"></a><a name="oApi_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oApi">oApi</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" even"><p>Container for all private functions in DataTables so they can be exposed externally</p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
496
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
497 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
498 </div></dd><dt class=" odd"><a name="ofnSearch"></a><a name="ofnSearch_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#ofnSearch">ofnSearch</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" odd"><p>Pre-processing of filtering data plug-ins - When you assign the sType for a column
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
499 (or have it automatically detected for you by DataTables or a type detection plug-in),
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
500 you will typically be using this for custom sorting, but it can also be used to provide
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
501 custom filtering by allowing you to pre-processing the data and returning the data in
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
502 the format that should be filtered upon. This is done by adding functions this object
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
503 with a parameter name which matches the sType for that target column. This is the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
504 corollary of <i>afnSortData</i> for filtering data.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
505 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
506 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
507 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
508 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
509 <li>{*} Data from the column cell to be prepared for filtering</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
510 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
511 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
512 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
513 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
514 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
515 <li>{string|null} Formatted string that will be used for the filtering.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
516 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
517 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
518 </ul></p>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
519
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
520 <p>Note that as of v1.9, it is typically preferable to use <i>mData</i> to prepare data for
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
521 the different uses that DataTables can put the data to. Specifically <i>mData</i> when
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
522 used as a function will give you a 'type' (sorting, filtering etc) that you can use to
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
523 prepare the data as required for the different types. As such, this method is deprecated.</p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
524 <dt class="important">Deprecated</dt><dd class="yes-def">Yes</dd>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
525 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
526 <h5>Example</h5>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
527 <div class="example-code">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
528 <pre class="brush: js"> $.fn.dataTableExt.ofnSearch['title-numeric'] = function ( sData ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
529 return sData.replace(/\n/g," ").replace( /<.*?>/g, "" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
530 }</pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
531 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
532 </div></dd><dt class=" even"><a name="oJUIClasses"></a><a name="oJUIClasses_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oJUIClasses">oJUIClasses</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" even"><p>Storage for the various classes that DataTables uses - jQuery UI suitable</p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
533
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
534 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
535 </div></dd><dt class=" odd"><a name="oPagination"></a><a name="oPagination_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oPagination">oPagination</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" odd"><p>Pagination plug-in methods - The style and controls of the pagination can significantly
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
536 impact on how the end user interacts with the data in your table, and DataTables allows
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
537 the addition of pagination controls by extending this object, which can then be enabled
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
538 through the <i>sPaginationType</i> initialisation parameter. Each pagination type that
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
539 is added is an object (the property name of which is what <i>sPaginationType</i> refers
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
540 to) that has two properties, both methods that are used by DataTables to update the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
541 control's state.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
542 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
543 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
544 fnInit - Initialisation of the paging controls. Called only during initialisation
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
545 of the table. It is expected that this function will add the required DOM elements
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
546 to the page for the paging controls to work. The element pointer
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
547 'oSettings.aanFeatures.p' array is provided by DataTables to contain the paging
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
548 controls (note that this is a 2D array to allow for multiple instances of each
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
549 DataTables DOM element). It is suggested that you add the controls to this element
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
550 as children
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
551 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
552 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
553 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
554 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
555 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
556 <li>{node} Container into which the pagination controls must be inserted</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
557 <li>{function} Draw callback function - whenever the controls cause a page
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
558 change, this method must be called to redraw the table.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
559 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
560 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
561 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
562 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
563 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
564 <li>No return required</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
565 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
566 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
567 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
568 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
569 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
570 fnInit - This function is called whenever the paging status of the table changes and is
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
571 typically used to update classes and/or text of the paging controls to reflex the new
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
572 status.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
573 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
574 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
575 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
576 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
577 <li>{object} DataTables settings object: see <a href="DataTable.models.oSettings.html">DataTable.models.oSettings</a>.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
578 <li>{function} Draw callback function - in case you need to redraw the table again
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
579 or attach new event listeners</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
580 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
581 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
582 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
583 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
584 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
585 <li>No return required</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
586 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
587 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
588 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
589 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
590 </ul></p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
591
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
592 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
593 <h5>Example</h5>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
594 <div class="example-code">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
595 <pre class="brush: js"> $.fn.dataTableExt.oPagination.four_button = {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
596 "fnInit": function ( oSettings, nPaging, fnCallbackDraw ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
597 nFirst = document.createElement( 'span' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
598 nPrevious = document.createElement( 'span' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
599 nNext = document.createElement( 'span' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
600 nLast = document.createElement( 'span' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
601
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
602 nFirst.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sFirst ) );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
603 nPrevious.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sPrevious ) );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
604 nNext.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sNext ) );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
605 nLast.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sLast ) );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
606
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
607 nFirst.className = "paginate_button first";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
608 nPrevious.className = "paginate_button previous";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
609 nNext.className="paginate_button next";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
610 nLast.className = "paginate_button last";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
611
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
612 nPaging.appendChild( nFirst );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
613 nPaging.appendChild( nPrevious );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
614 nPaging.appendChild( nNext );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
615 nPaging.appendChild( nLast );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
616
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
617 $(nFirst).click( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
618 oSettings.oApi._fnPageChange( oSettings, "first" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
619 fnCallbackDraw( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
620 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
621
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
622 $(nPrevious).click( function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
623 oSettings.oApi._fnPageChange( oSettings, "previous" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
624 fnCallbackDraw( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
625 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
626
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
627 $(nNext).click( function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
628 oSettings.oApi._fnPageChange( oSettings, "next" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
629 fnCallbackDraw( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
630 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
631
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
632 $(nLast).click( function() {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
633 oSettings.oApi._fnPageChange( oSettings, "last" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
634 fnCallbackDraw( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
635 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
636
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
637 $(nFirst).bind( 'selectstart', function () { return false; } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
638 $(nPrevious).bind( 'selectstart', function () { return false; } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
639 $(nNext).bind( 'selectstart', function () { return false; } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
640 $(nLast).bind( 'selectstart', function () { return false; } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
641 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
642
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
643 "fnUpdate": function ( oSettings, fnCallbackDraw ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
644 if ( !oSettings.aanFeatures.p ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
645 return;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
646 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
647
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
648 // Loop over each instance of the pager
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
649 var an = oSettings.aanFeatures.p;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
650 for ( var i=0, iLen=an.length ; i<iLen ; i++ ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
651 var buttons = an[i].getElementsByTagName('span');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
652 if ( oSettings._iDisplayStart === 0 ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
653 buttons[0].className = "paginate_disabled_previous";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
654 buttons[1].className = "paginate_disabled_previous";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
655 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
656 else {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
657 buttons[0].className = "paginate_enabled_previous";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
658 buttons[1].className = "paginate_enabled_previous";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
659 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
660
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
661 if ( oSettings.fnDisplayEnd() == oSettings.fnRecordsDisplay() ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
662 buttons[2].className = "paginate_disabled_next";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
663 buttons[3].className = "paginate_disabled_next";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
664 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
665 else {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
666 buttons[2].className = "paginate_enabled_next";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
667 buttons[3].className = "paginate_enabled_next";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
668 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
669 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
670 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
671 };</pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
672 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
673 </div></dd><dt class=" even"><a name="oSort"></a><a name="oSort_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oSort">oSort</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" even"><p>Sorting plug-in methods - Sorting in DataTables is based on the detected type of the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
674 data column (you can add your own type detection functions, or override automatic
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
675 detection using sType). With this specific type given to the column, DataTables will
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
676 apply the required sort from the functions in the object. Each sort type must provide
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
677 two mandatory methods, one each for ascending and descending sorting, and can optionally
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
678 provide a pre-formatting method that will help speed up sorting by allowing DataTables
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
679 to pre-format the sort data only once (rather than every time the actual sort functions
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
680 are run). The two sorting functions are typical Javascript sort methods:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
681 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
682 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
683 Function input parameters:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
684 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
685 <li>{<em>} Data to compare to the second parameter</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
686 <li>{</em>} Data to compare to the first parameter</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
687 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
688 </li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
689 <li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
690 Function return:
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
691 <ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
692 <li>{int} Sorting match: &lt;0 if first parameter should be sorted lower than
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
693 the second parameter, ===0 if the two parameters are equal and >0 if
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
694 the first parameter should be sorted height than the second parameter.</li>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
695 </ul>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
696 </il>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
697 </ul></p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
698
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
699 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
700 <h5>Examples</h5>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
701 <div class="example-code">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
702 <pre class="brush: js"> // Case-sensitive string sorting, with no pre-formatting method
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
703 $.extend( $.fn.dataTableExt.oSort, {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
704 "string-case-asc": function(x,y) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
705 return ((x < y) ? -1 : ((x > y) ? 1 : 0));
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
706 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
707 "string-case-desc": function(x,y) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
708 return ((x < y) ? 1 : ((x > y) ? -1 : 0));
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
709 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
710 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
711
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
712 </pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
713 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
714
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
715 <div class="example-code">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
716 <pre class="brush: js"> // Case-insensitive string sorting, with pre-formatting
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
717 $.extend( $.fn.dataTableExt.oSort, {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
718 "string-pre": function(x) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
719 return x.toLowerCase();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
720 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
721 "string-asc": function(x,y) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
722 return ((x < y) ? -1 : ((x > y) ? 1 : 0));
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
723 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
724 "string-desc": function(x,y) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
725 return ((x < y) ? 1 : ((x > y) ? -1 : 0));
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
726 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
727 } );</pre>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
728 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
729 </div></dd><dt class=" odd"><a name="oStdClasses"></a><a name="oStdClasses_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#oStdClasses">oStdClasses</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" odd"><p>Storage for the various classes that DataTables uses</p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
730
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
731 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
732 </div></dd><dt class=" even"><a name="sErrMode"></a><a name="sErrMode_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#sErrMode">sErrMode</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>How should DataTables report an error. Can take the value 'alert' or 'throw'</p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
733
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
734 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
735 </div></dd><dt class=" odd"><a name="sVersion"></a><a name="sVersion_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#sVersion">sVersion</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>Version string for plug-ins to check compatibility. Allowed format is
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
736 a.b.c.d.e where: a:int, b:int, c:int, d:string(dev|beta), e:int. d and
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
737 e are optional</p><div class="collapse_details"><dl class="details">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
738
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
739 </dl>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
740 </div></dd>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
741 </dl></div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
742 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
743
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
744 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
745
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
746 <div class="fw_footer">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
747 DataTables: Copyright 2008-2012 Allan Jardine, all rights reserved<br>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
748
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
749 Documentation generated by <a href="https://github.com/micmath/JSDoc">JSDoc 3</a> on
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
750 23th Sep 2012 - 14:27
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
751 with the <a href="http://datatables.net/">DataTables</a> template.
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
752 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
753 </body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
754 </html>