annotate DataTables-1.9.4/media/src/core/core.constructor.js @ 7:0f2b740536fb draft

Uploaded
author saskia-hiltemann
date Mon, 21 Aug 2017 09:16:07 -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 var i=0, iLen, j, jLen, k, kLen;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 var sId = this.getAttribute( 'id' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3 var bInitHandedOff = false;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 var bUsePassedData = false;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 /* Sanity check */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 if ( this.nodeName.toLowerCase() != 'table' )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 _fnLog( null, 0, "Attempted to initialise DataTables on a node which is not a "+
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11 "table: "+this.nodeName );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 return;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 /* Check to see if we are re-initialising a table */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 for ( i=0, iLen=DataTable.settings.length ; i<iLen ; i++ )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 /* Base check on table node */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 if ( DataTable.settings[i].nTable == this )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 if ( oInit === undefined || oInit.bRetrieve )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 return DataTable.settings[i].oInstance;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 else if ( oInit.bDestroy )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 DataTable.settings[i].oInstance.fnDestroy();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 break;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 else
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 _fnLog( DataTable.settings[i], 0, "Cannot reinitialise DataTable.\n\n"+
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 "To retrieve the DataTables object for this table, pass no arguments or see "+
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 "the docs for bRetrieve and bDestroy" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 return;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 /* If the element we are initialising has the same ID as a table which was previously
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 * initialised, but the table nodes don't match (from before) then we destroy the old
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 * instance by simply deleting it. This is under the assumption that the table has been
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 * destroyed by other methods. Anyone using non-id selectors will need to do this manually
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 if ( DataTable.settings[i].sTableId == this.id )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 DataTable.settings.splice( i, 1 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 break;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 /* Ensure the table has an ID - required for accessibility */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 if ( sId === null || sId === "" )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 sId = "DataTables_Table_"+(DataTable.ext._oExternConfig.iNextUnique++);
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 this.id = sId;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 /* Create the settings object for this table and set some of the default parameters */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 var oSettings = $.extend( true, {}, DataTable.models.oSettings, {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 "nTable": this,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 "oApi": _that.oApi,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 "oInit": oInit,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 "sDestroyWidth": $(this).width(),
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 "sInstance": sId,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 "sTableId": sId
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 DataTable.settings.push( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 // Need to add the instance after the instance after the settings object has been added
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 // to the settings array, so we can self reference the table instance if more than one
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 oSettings.oInstance = (_that.length===1) ? _that : $(this).dataTable();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 /* Setting up the initialisation object */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 if ( !oInit )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76 oInit = {};
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79 // Backwards compatibility, before we apply all the defaults
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
80 if ( oInit.oLanguage )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82 _fnLanguageCompat( oInit.oLanguage );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
83 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
84
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
85 oInit = _fnExtend( $.extend(true, {}, DataTable.defaults), oInit );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
86
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
87 // Map the initialisation options onto the settings object
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
88 _fnMap( oSettings.oFeatures, oInit, "bPaginate" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
89 _fnMap( oSettings.oFeatures, oInit, "bLengthChange" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
90 _fnMap( oSettings.oFeatures, oInit, "bFilter" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
91 _fnMap( oSettings.oFeatures, oInit, "bSort" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
92 _fnMap( oSettings.oFeatures, oInit, "bInfo" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
93 _fnMap( oSettings.oFeatures, oInit, "bProcessing" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
94 _fnMap( oSettings.oFeatures, oInit, "bAutoWidth" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
95 _fnMap( oSettings.oFeatures, oInit, "bSortClasses" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
96 _fnMap( oSettings.oFeatures, oInit, "bServerSide" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
97 _fnMap( oSettings.oFeatures, oInit, "bDeferRender" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
98 _fnMap( oSettings.oScroll, oInit, "sScrollX", "sX" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
99 _fnMap( oSettings.oScroll, oInit, "sScrollXInner", "sXInner" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
100 _fnMap( oSettings.oScroll, oInit, "sScrollY", "sY" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
101 _fnMap( oSettings.oScroll, oInit, "bScrollCollapse", "bCollapse" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
102 _fnMap( oSettings.oScroll, oInit, "bScrollInfinite", "bInfinite" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
103 _fnMap( oSettings.oScroll, oInit, "iScrollLoadGap", "iLoadGap" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
104 _fnMap( oSettings.oScroll, oInit, "bScrollAutoCss", "bAutoCss" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
105 _fnMap( oSettings, oInit, "asStripeClasses" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
106 _fnMap( oSettings, oInit, "asStripClasses", "asStripeClasses" ); // legacy
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
107 _fnMap( oSettings, oInit, "fnServerData" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
108 _fnMap( oSettings, oInit, "fnFormatNumber" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
109 _fnMap( oSettings, oInit, "sServerMethod" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
110 _fnMap( oSettings, oInit, "aaSorting" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
111 _fnMap( oSettings, oInit, "aaSortingFixed" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
112 _fnMap( oSettings, oInit, "aLengthMenu" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
113 _fnMap( oSettings, oInit, "sPaginationType" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
114 _fnMap( oSettings, oInit, "sAjaxSource" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
115 _fnMap( oSettings, oInit, "sAjaxDataProp" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
116 _fnMap( oSettings, oInit, "iCookieDuration" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
117 _fnMap( oSettings, oInit, "sCookiePrefix" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
118 _fnMap( oSettings, oInit, "sDom" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
119 _fnMap( oSettings, oInit, "bSortCellsTop" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
120 _fnMap( oSettings, oInit, "iTabIndex" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
121 _fnMap( oSettings, oInit, "oSearch", "oPreviousSearch" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
122 _fnMap( oSettings, oInit, "aoSearchCols", "aoPreSearchCols" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
123 _fnMap( oSettings, oInit, "iDisplayLength", "_iDisplayLength" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
124 _fnMap( oSettings, oInit, "bJQueryUI", "bJUI" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
125 _fnMap( oSettings, oInit, "fnCookieCallback" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
126 _fnMap( oSettings, oInit, "fnStateLoad" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
127 _fnMap( oSettings, oInit, "fnStateSave" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
128 _fnMap( oSettings.oLanguage, oInit, "fnInfoCallback" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
129
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
130 /* Callback functions which are array driven */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
131 _fnCallbackReg( oSettings, 'aoDrawCallback', oInit.fnDrawCallback, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
132 _fnCallbackReg( oSettings, 'aoServerParams', oInit.fnServerParams, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
133 _fnCallbackReg( oSettings, 'aoStateSaveParams', oInit.fnStateSaveParams, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
134 _fnCallbackReg( oSettings, 'aoStateLoadParams', oInit.fnStateLoadParams, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
135 _fnCallbackReg( oSettings, 'aoStateLoaded', oInit.fnStateLoaded, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
136 _fnCallbackReg( oSettings, 'aoRowCallback', oInit.fnRowCallback, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
137 _fnCallbackReg( oSettings, 'aoRowCreatedCallback', oInit.fnCreatedRow, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
138 _fnCallbackReg( oSettings, 'aoHeaderCallback', oInit.fnHeaderCallback, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
139 _fnCallbackReg( oSettings, 'aoFooterCallback', oInit.fnFooterCallback, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
140 _fnCallbackReg( oSettings, 'aoInitComplete', oInit.fnInitComplete, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
141 _fnCallbackReg( oSettings, 'aoPreDrawCallback', oInit.fnPreDrawCallback, 'user' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
142
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
143 if ( oSettings.oFeatures.bServerSide && oSettings.oFeatures.bSort &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
144 oSettings.oFeatures.bSortClasses )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
145 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
146 /* Enable sort classes for server-side processing. Safe to do it here, since server-side
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
147 * processing must be enabled by the developer
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
148 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
149 _fnCallbackReg( oSettings, 'aoDrawCallback', _fnSortingClasses, 'server_side_sort_classes' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
150 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
151 else if ( oSettings.oFeatures.bDeferRender )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
152 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
153 _fnCallbackReg( oSettings, 'aoDrawCallback', _fnSortingClasses, 'defer_sort_classes' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
154 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
155
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
156 if ( oInit.bJQueryUI )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
157 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
158 /* Use the JUI classes object for display. You could clone the oStdClasses object if
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
159 * you want to have multiple tables with multiple independent classes
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
160 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
161 $.extend( oSettings.oClasses, DataTable.ext.oJUIClasses );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
162
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
163 if ( oInit.sDom === DataTable.defaults.sDom && DataTable.defaults.sDom === "lfrtip" )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
164 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
165 /* Set the DOM to use a layout suitable for jQuery UI's theming */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
166 oSettings.sDom = '<"H"lfr>t<"F"ip>';
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
167 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
168 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
169 else
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
170 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
171 $.extend( oSettings.oClasses, DataTable.ext.oStdClasses );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
172 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
173 $(this).addClass( oSettings.oClasses.sTable );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
174
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
175 /* Calculate the scroll bar width and cache it for use later on */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
176 if ( oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "" )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
177 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
178 oSettings.oScroll.iBarWidth = _fnScrollBarWidth();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
179 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
180
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
181 if ( oSettings.iInitDisplayStart === undefined )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
182 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
183 /* Display start point, taking into account the save saving */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
184 oSettings.iInitDisplayStart = oInit.iDisplayStart;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
185 oSettings._iDisplayStart = oInit.iDisplayStart;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
186 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
187
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
188 /* Must be done after everything which can be overridden by a cookie! */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
189 if ( oInit.bStateSave )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
190 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
191 oSettings.oFeatures.bStateSave = true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
192 _fnLoadState( oSettings, oInit );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
193 _fnCallbackReg( oSettings, 'aoDrawCallback', _fnSaveState, 'state_save' );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
194 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
195
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
196 if ( oInit.iDeferLoading !== null )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
197 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
198 oSettings.bDeferLoading = true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
199 var tmp = $.isArray( oInit.iDeferLoading );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
200 oSettings._iRecordsDisplay = tmp ? oInit.iDeferLoading[0] : oInit.iDeferLoading;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
201 oSettings._iRecordsTotal = tmp ? oInit.iDeferLoading[1] : oInit.iDeferLoading;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
202 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
203
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
204 if ( oInit.aaData !== null )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
205 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
206 bUsePassedData = true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
207 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
208
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
209 /* Language definitions */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
210 if ( oInit.oLanguage.sUrl !== "" )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
211 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
212 /* Get the language definitions from a file - because this Ajax call makes the language
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
213 * get async to the remainder of this function we use bInitHandedOff to indicate that
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
214 * _fnInitialise will be fired by the returned Ajax handler, rather than the constructor
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
215 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
216 oSettings.oLanguage.sUrl = oInit.oLanguage.sUrl;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
217 $.getJSON( oSettings.oLanguage.sUrl, null, function( json ) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
218 _fnLanguageCompat( json );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
219 $.extend( true, oSettings.oLanguage, oInit.oLanguage, json );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
220 _fnInitialise( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
221 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
222 bInitHandedOff = true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
223 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
224 else
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
225 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
226 $.extend( true, oSettings.oLanguage, oInit.oLanguage );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
227 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
228
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
229
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
230 /*
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
231 * Stripes
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
232 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
233 if ( oInit.asStripeClasses === null )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
234 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
235 oSettings.asStripeClasses =[
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
236 oSettings.oClasses.sStripeOdd,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
237 oSettings.oClasses.sStripeEven
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
238 ];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
239 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
240
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
241 /* Remove row stripe classes if they are already on the table row */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
242 iLen=oSettings.asStripeClasses.length;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
243 oSettings.asDestroyStripes = [];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
244 if (iLen)
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
245 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
246 var bStripeRemove = false;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
247 var anRows = $(this).children('tbody').children('tr:lt(' + iLen + ')');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
248 for ( i=0 ; i<iLen ; i++ )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
249 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
250 if ( anRows.hasClass( oSettings.asStripeClasses[i] ) )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
251 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
252 bStripeRemove = true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
253
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
254 /* Store the classes which we are about to remove so they can be re-added on destroy */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
255 oSettings.asDestroyStripes.push( oSettings.asStripeClasses[i] );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
256 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
257 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
258
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
259 if ( bStripeRemove )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
260 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
261 anRows.removeClass( oSettings.asStripeClasses.join(' ') );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
262 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
263 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
264
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
265 /*
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
266 * Columns
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
267 * See if we should load columns automatically or use defined ones
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
268 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
269 var anThs = [];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
270 var aoColumnsInit;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
271 var nThead = this.getElementsByTagName('thead');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
272 if ( nThead.length !== 0 )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
273 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
274 _fnDetectHeader( oSettings.aoHeader, nThead[0] );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
275 anThs = _fnGetUniqueThs( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
276 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
277
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
278 /* If not given a column array, generate one with nulls */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
279 if ( oInit.aoColumns === null )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
280 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
281 aoColumnsInit = [];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
282 for ( i=0, iLen=anThs.length ; i<iLen ; i++ )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
283 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
284 aoColumnsInit.push( null );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
285 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
286 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
287 else
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
288 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
289 aoColumnsInit = oInit.aoColumns;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
290 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
291
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
292 /* Add the columns */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
293 for ( i=0, iLen=aoColumnsInit.length ; i<iLen ; i++ )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
294 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
295 /* Short cut - use the loop to check if we have column visibility state to restore */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
296 if ( oInit.saved_aoColumns !== undefined && oInit.saved_aoColumns.length == iLen )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
297 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
298 if ( aoColumnsInit[i] === null )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
299 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
300 aoColumnsInit[i] = {};
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
301 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
302 aoColumnsInit[i].bVisible = oInit.saved_aoColumns[i].bVisible;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
303 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
304
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
305 _fnAddColumn( oSettings, anThs ? anThs[i] : null );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
306 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
307
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
308 /* Apply the column definitions */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
309 _fnApplyColumnDefs( oSettings, oInit.aoColumnDefs, aoColumnsInit, function (iCol, oDef) {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
310 _fnColumnOptions( oSettings, iCol, oDef );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
311 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
312
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
313
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
314 /*
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
315 * Sorting
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
316 * Check the aaSorting array
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
317 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
318 for ( i=0, iLen=oSettings.aaSorting.length ; i<iLen ; i++ )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
319 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
320 if ( oSettings.aaSorting[i][0] >= oSettings.aoColumns.length )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
321 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
322 oSettings.aaSorting[i][0] = 0;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
323 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
324 var oColumn = oSettings.aoColumns[ oSettings.aaSorting[i][0] ];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
325
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
326 /* Add a default sorting index */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
327 if ( oSettings.aaSorting[i][2] === undefined )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
328 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
329 oSettings.aaSorting[i][2] = 0;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
330 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
331
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
332 /* If aaSorting is not defined, then we use the first indicator in asSorting */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
333 if ( oInit.aaSorting === undefined && oSettings.saved_aaSorting === undefined )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
334 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
335 oSettings.aaSorting[i][1] = oColumn.asSorting[0];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
336 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
337
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
338 /* Set the current sorting index based on aoColumns.asSorting */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
339 for ( j=0, jLen=oColumn.asSorting.length ; j<jLen ; j++ )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
340 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
341 if ( oSettings.aaSorting[i][1] == oColumn.asSorting[j] )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
342 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
343 oSettings.aaSorting[i][2] = j;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
344 break;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
345 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
346 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
347 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
348
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
349 /* Do a first pass on the sorting classes (allows any size changes to be taken into
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
350 * account, and also will apply sorting disabled classes if disabled
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
351 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
352 _fnSortingClasses( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
353
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
354
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
355 /*
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
356 * Final init
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
357 * Cache the header, body and footer as required, creating them if needed
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
358 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
359
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
360 /* Browser support detection */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
361 _fnBrowserDetect( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
362
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
363 // Work around for Webkit bug 83867 - store the caption-side before removing from doc
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
364 var captions = $(this).children('caption').each( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
365 this._captionSide = $(this).css('caption-side');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
366 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
367
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
368 var thead = $(this).children('thead');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
369 if ( thead.length === 0 )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
370 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
371 thead = [ document.createElement( 'thead' ) ];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
372 this.appendChild( thead[0] );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
373 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
374 oSettings.nTHead = thead[0];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
375
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
376 var tbody = $(this).children('tbody');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
377 if ( tbody.length === 0 )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
378 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
379 tbody = [ document.createElement( 'tbody' ) ];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
380 this.appendChild( tbody[0] );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
381 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
382 oSettings.nTBody = tbody[0];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
383 oSettings.nTBody.setAttribute( "role", "alert" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
384 oSettings.nTBody.setAttribute( "aria-live", "polite" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
385 oSettings.nTBody.setAttribute( "aria-relevant", "all" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
386
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
387 var tfoot = $(this).children('tfoot');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
388 if ( tfoot.length === 0 && captions.length > 0 && (oSettings.oScroll.sX !== "" || oSettings.oScroll.sY !== "") )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
389 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
390 // If we are a scrolling table, and no footer has been given, then we need to create
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
391 // a tfoot element for the caption element to be appended to
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
392 tfoot = [ document.createElement( 'tfoot' ) ];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
393 this.appendChild( tfoot[0] );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
394 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
395
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
396 if ( tfoot.length > 0 )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
397 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
398 oSettings.nTFoot = tfoot[0];
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
399 _fnDetectHeader( oSettings.aoFooter, oSettings.nTFoot );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
400 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
401
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
402 /* Check if there is data passing into the constructor */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
403 if ( bUsePassedData )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
404 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
405 for ( i=0 ; i<oInit.aaData.length ; i++ )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
406 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
407 _fnAddData( oSettings, oInit.aaData[ i ] );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
408 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
409 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
410 else
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
411 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
412 /* Grab the data from the page */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
413 _fnGatherData( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
414 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
415
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
416 /* Copy the data index array */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
417 oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
418
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
419 /* Initialisation complete - table can be drawn */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
420 oSettings.bInitialised = true;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
421
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
422 /* Check if we need to initialise the table (it might not have been handed off to the
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
423 * language processor)
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
424 */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
425 if ( bInitHandedOff === false )
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
426 {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
427 _fnInitialise( oSettings );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
428 }