DataTable.defaults.html
117 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Namespace: defaults - documentation</title>
<style type="text/css" media="screen">
@import "media/css/doc.css";
@import "media/css/shCore.css";
@import "media/css/shThemeDataTables.css";
</style>
<script type="text/javascript" src="media/js/shCore.js"></script>
<script type="text/javascript" src="media/js/shBrushJScript.js"></script>
<script type="text/javascript" src="media/js/jquery.js"></script>
<script type="text/javascript" src="media/js/doc.js"></script>
</head>
<body>
<div class="fw_container">
<a name="top"></a>
<div class="fw_header">
<h1 class="page-title">Namespace: defaults</h1>
<h2 class="ancestors">Ancestry: <span class="ancestors"><a href="DataTable.html">DataTable</a>.</span> » defaults</h2>
<div class="page-info">
DataTables v1.9.4 documentation
</div>
</div>
<div class="fw_nav">
<h2>Navigation</h2>
<ul>
<li><a href="#top">Overview</a></li>
<li><a href="#summary">Summary</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Classes (0)</td><td><a href="#summary_namespaces">Namespaces (3)</a></td></tr><tr><td>Properties (0)</td><td><a href="#summary_properties_static">Static properties (58)</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 (58)</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>
<div style="margin-top: 10px;">
<input type="hidden" name="show_private" value="0">
<span id="private_label">Hiding</span> private elements
(<a id="private_toggle" href="">toggle</a>)
</span>
</div>
<div>
<input type="hidden" name="show_extended" value="1">
<span id="extended_label">Showing</span> extended elements
(<a id="extended_toggle" href="">toggle</a>)
</span>
</div>
</div>
<div class="fw_content">
<a name="overview"></a>
<div class="doc_overview">
<div class="nav_blocker"></div>
<p>Initialisation options that can be given to DataTables at initialisation
time.</p><dl class="details">
</dl>
</div>
<div class="doc_summary">
<a name="summary"></a>
<h2>Summary</h2>
<div class="doc_group"><a name="summary_namespaces"></a><h3 class="subsection-title">Namespaces</h3>
<dl>
<dt class="even"><span class="type-name"><a href="DataTable.defaults.columns.html">columns</a></span></dt><dd class="even"><p>Column options that can be given to DataTables at initialisation time.</p></dd><dt class="odd"><span class="type-name"><a href="DataTable.defaults.oLanguage.html">oLanguage</a></span></dt><dd class="odd"><p>All strings that DataTables uses in the user interface that it creates
are defined in this object, allowing you to modified them individually or
completely replace them all as required.</p></dd><dt class="even"><span class="type-name"><a href="DataTable.defaults.oSearch.html">oSearch</a></span></dt><dd class="even"><p>This parameter allows you to have define the global filtering state at
initialisation time. As an object the "sSearch" parameter must be
defined, but all other parameters are optional. When "bRegex" is true,
the search string will be treated as a regular expression, when false
(default) it will be treated as a straight string. When "bSmart"
DataTables will use it's smart filtering methods (to word match at
any point in the data), when false this will not be done.</p></dd>
</dl></div><div class="doc_group"><a name="summary_properties_static"></a><h3 class="subsection-title">Properties - static</h3>
<dl>
<dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aaData">aaData</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>An array of data to use for the table, passed in at initialisation which
will be used in preference to any data which is already in the DOM. This is
particularly useful for constructing tables purely in Javascript, for
example with a custom Ajax call.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aaSorting">aaSorting</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>If sorting is enabled, then DataTables will perform a first pass sort on
initialisation. You can define which column(s) the sort is performed upon,
and the sorting direction, with this variable. The aaSorting array should
contain an array for each column to be sorted initially containing the
column's index and a direction string ('asc' or 'desc').</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aaSortingFixed">aaSortingFixed</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>This parameter is basically identical to the aaSorting parameter, but
cannot be overridden by user interaction with the table. What this means
is that you could have a column (visible or hidden) which the sorting will
always be forced on first - any sorting after that (from the user) will
then be performed as required. This can be useful for grouping rows
together.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aLengthMenu">aLengthMenu</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>This parameter allows you to readily specify the entries in the length drop
down menu that DataTables shows when pagination is enabled. It can be
either a 1D array of options which will be used for both the displayed
option and the value, or a 2D array which will use the array in the first
position as the value, and the array in the second position as the
displayed options (useful for language strings such as 'All').</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aoColumnDefs">aoColumnDefs</a></span><span class="type-sig"><span class="type-signature"></span></span></dt><dd class=" even"><p>Very similar to aoColumns, aoColumnDefs allows you to target a specific
column, multiple columns, or all columns, using the aTargets property of
each object in the array. This allows great flexibility when creating
tables, as the aoColumnDefs arrays can be of any length, targeting the
columns you specifically want. aoColumnDefs may use any of the column
options available: <a href="DataTable.defaults.columns.html">DataTable.defaults.columns</a>, but it <em>must</em>
have aTargets defined in each object in the array. Values in the aTargets
array may be:
<ul>
<li>a string - class name will be matched on the TH for the column</li>
<li>0 or a positive integer - column index counting from the left</li>
<li>a negative integer - column index counting from the right</li>
<li>the string "_all" - all columns (i.e. assign a default)</li>
</ul></p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aoColumns">aoColumns</a></span><span class="type-sig"><span class="type-signature"></span></span></dt><dd class=" odd"><p>The aoColumns option in the initialisation parameter allows you to define
details about the way individual columns behave. For a full list of
column options that can be set, please see
<a href="DataTable.defaults.columns.html">DataTable.defaults.columns</a>. Note that if you use aoColumns to
define your columns, you must have an entry in the array for every single
column that you have in your table (these can be null if you don't which
to specify any options).</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aoSearchCols">aoSearchCols</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>Basically the same as oSearch, this parameter defines the individual column
filtering state at initialisation time. The array must be of the same size
as the number of columns, and each element be an object with the parameters
"sSearch" and "bEscapeRegex" (the latter is optional). 'null' is also
accepted and the default will be used.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#asStripeClasses">asStripeClasses</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>An array of CSS classes that should be applied to displayed rows. This
array may be of any length, and DataTables will apply each class
sequentially, looping when required.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bAutoWidth">bAutoWidth</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable automatic column width calculation. This can be disabled
as an optimisation (it takes some time to calculate the widths) if the
tables widths are passed in using aoColumns.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bDeferRender">bDeferRender</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Deferred rendering can provide DataTables with a huge speed boost when you
are using an Ajax or JS data source for the table. This option, when set to
true, will cause DataTables to defer the creation of the table elements for
each row until they are needed for a draw - saving a significant amount of
time.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bDestroy">bDestroy</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Replace a DataTable which matches the given selector and replace it with
one which has the properties of the new initialisation object passed. If no
table matches the selector, then the new DataTable will be constructed as
per normal.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bFilter">bFilter</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Enable or disable filtering of data. Filtering in DataTables is "smart" in
that it allows the end user to input multiple words (space separated) and
will match a row containing those words, even if not in the order that was
specified (this allow matching across multiple columns). Note that if you
wish to use filtering in DataTables this must remain 'true' - to remove the
default filtering input box and retain filtering abilities, please use
<a href="DataTable.defaults.html#sDom">DataTable.defaults.sDom</a>.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bInfo">bInfo</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable the table information display. This shows information
about the data that is currently visible on the page, including information
about filtered data if that action is being performed.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bJQueryUI">bJQueryUI</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Enable jQuery UI ThemeRoller support (required as ThemeRoller requires some
slightly different and additional mark-up from what DataTables has
traditionally used).</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bLengthChange">bLengthChange</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Allows the end user to select the size of a formatted page from a select
menu (sizes are 10, 25, 50 and 100). Requires pagination (bPaginate).</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bPaginate">bPaginate</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Enable or disable pagination.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bProcessing">bProcessing</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable the display of a 'processing' indicator when the table is
being processed (e.g. a sort). This is particularly useful for tables with
large amounts of data where it can take a noticeable amount of time to sort
the entries.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bRetrieve">bRetrieve</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Retrieve the DataTables object for the given selector. Note that if the
table has already been initialised, this parameter will cause DataTables
to simply return the object that has already been set up - it will not take
account of any changes you might have made to the initialisation object
passed to DataTables (setting this parameter to true is an acknowledgement
that you understand this). bDestroy can be used to reinitialise a table if
you need.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bScrollAutoCss">bScrollAutoCss</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Indicate if DataTables should be allowed to set the padding / margin
etc for the scrolling header elements or not. Typically you will want
this.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bScrollCollapse">bScrollCollapse</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>When vertical (y) scrolling is enabled, DataTables will force the height of
the table's viewport to the given height at all times (useful for layout).
However, this can look odd when filtering data down to a small data set,
and the footer is left "floating" further down. This parameter (when
enabled) will cause DataTables to collapse the table's viewport down when
the result set will fit within the given Y height.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bScrollInfinite">bScrollInfinite</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable infinite scrolling for DataTables (to be used in combination with
sScrollY). Infinite scrolling means that DataTables will continually load
data as a user scrolls through a table, which is very useful for large
dataset. This cannot be used with pagination, which is automatically
disabled. Note - the Scroller extra for DataTables is recommended in
in preference to this option.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bServerSide">bServerSide</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Configure DataTables to use server-side processing. Note that the
sAjaxSource parameter must also be given in order to give DataTables a
source to obtain the required data for each draw.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bSort">bSort</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable sorting of columns. Sorting of individual columns can be
disabled by the "bSortable" option for each column.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bSortCellsTop">bSortCellsTop</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Allows control over whether DataTables should use the top (true) unique
cell that is found for a single column, or the bottom (false - default).
This is useful when using complex headers.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bSortClasses">bSortClasses</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable the addition of the classes 'sorting_1', 'sorting_2' and
'sorting_3' to the columns which are currently being sorted on. This is
presented as a feature switch as it can increase processing time (while
classes are removed and added) so for large data sets you might want to
turn this off.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bStateSave">bStateSave</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Enable or disable state saving. When enabled a cookie will be used to save
table display information such as pagination information, display length,
filtering and sorting. As such when the end user reloads the page the
display display will match what thy had previously set up.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnCookieCallback">fnCookieCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>Customise the cookie and / or the parameters being stored when using
DataTables with state saving enabled. This function is called whenever
the cookie is modified, and it expects a fully formed cookie string to be
returned. Note that the data object passed in is a Javascript object which
must be converted to a string (JSON.stringify for example).</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnCreatedRow">fnCreatedRow</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" odd"><p>This function is called when a TR element is created (and all TD child
elements have been inserted), or registered if using a DOM source, allowing
manipulation of the TR element (adding classes etc).</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnDrawCallback">fnDrawCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>This function is called on every 'draw' event, and allows you to
dynamically modify any aspect you want about the created DOM.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnFooterCallback">fnFooterCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" odd"><p>Identical to fnHeaderCallback() but for the table footer this function
allows you to modify the table footer on every 'draw' even.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnFormatNumber">fnFormatNumber</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>When rendering large numbers in the information element for the table
(i.e. "Showing 1 to 10 of 57 entries") DataTables will render large numbers
to have a comma separator for the 'thousands' units (e.g. 1 million is
rendered as "1,000,000") to help readability for the end user. This
function will override the default method DataTables uses.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnHeaderCallback">fnHeaderCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" odd"><p>This function is called on every 'draw' event, and allows you to
dynamically modify the header row. This can be used to calculate and
display useful information about the table.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnInfoCallback">fnInfoCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>The information element can be used to convey information about the current
state of the table. Although the internationalisation options presented by
DataTables are quite capable of dealing with most customisations, there may
be times where you wish to customise the string further. This callback
allows you to do exactly that.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnInitComplete">fnInitComplete</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" odd"><p>Called when the table has been initialised. Normally DataTables will
initialise sequentially and there will be no need for this function,
however, this does not hold true when using external language information
since that is obtained using an async XHR call.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnPreDrawCallback">fnPreDrawCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>Called at the very start of each table draw and can be used to cancel the
draw by returning false, any other return (including undefined) results in
the full draw occurring).</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnRowCallback">fnRowCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" odd"><p>This function allows you to 'post process' each row after it have been
generated for each table draw, but before it is rendered on screen. This
function might be used for setting the row class name etc.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnServerData">fnServerData</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>This parameter allows you to override the default function which obtains
the data from the server ($.getJSON) so something more suitable for your
application. For example you could use POST data, or pull information from
a Gears or AIR database.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnServerParams">fnServerParams</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" odd"><p>It is often useful to send extra data to the server when making an Ajax
request - for example custom filtering information, and this callback
function makes it trivial to send extra information to the server. The
passed in parameter is the data set that has been constructed by
DataTables, and you can add to this or modify it as you require.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnStateLoad">fnStateLoad</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>Load the table state. With this function you can define from where, and how, the
state of a table is loaded. By default DataTables will load from its state saving
cookie, but you might wish to use local storage (HTML5) or a server-side database.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnStateLoaded">fnStateLoaded</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" odd"><p>Callback that is called when the state has been loaded from the state saving method
and the DataTables settings object has been modified as a result of the loaded state.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnStateLoadParams">fnStateLoadParams</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>Callback which allows modification of the saved state prior to loading that state.
This callback is called when the table is loading state from the stored data, but
prior to the settings object being modified by the saved state. Note that for
plug-in authors, you should use the 'stateLoadParams' event to load parameters for
a plug-in.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnStateSave">fnStateSave</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" odd"><p>Save the table state. This function allows you to define where and how the state
information for the table is stored - by default it will use a cookie, but you
might want to use local storage (HTML5) or a server-side database.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#fnStateSaveParams">fnStateSaveParams</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></dt><dd class=" even"><p>Callback which allows modification of the state to be saved. Called when the table
has changed state a new state save is required. This method allows modification of
the state saving object prior to actually doing the save, including addition or
other state properties or modification. Note that for plug-in authors, you should
use the 'stateSaveParams' event to save parameters for a plug-in.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iCookieDuration">iCookieDuration</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Duration of the cookie which is used for storing session information. This
value is given in seconds.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iDeferLoading">iDeferLoading</a></span><span class="type-sig"><span class="type-signature"> :int|array</span></span></dt><dd class=" even"><p>When enabled DataTables will not make a request to the server for the first
page draw - rather it will use the data already on the page (no sorting etc
will be applied to it), thus saving on an XHR at load time. iDeferLoading
is used to indicate that deferred loading is required, but it is also used
to tell DataTables how many records there are in the full table (allowing
the information element and pagination to be displayed correctly). In the case
where a filtering is applied to the table on initial load, this can be
indicated by giving the parameter as an array, where the first element is
the number of records available after filtering and the second element is the
number of records without filtering (allowing the table information element
to be shown correctly).</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iDisplayLength">iDisplayLength</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Number of rows to display on a single page when using pagination. If
feature enabled (bLengthChange) then the end user will be able to override
this to a custom setting using a pop-up menu.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iDisplayStart">iDisplayStart</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>Define the starting point for data display when using DataTables with
pagination. Note that this parameter is the number of records, rather than
the page number, so if you have 10 records per page and want to start on
the third page, it should be "20".</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iScrollLoadGap">iScrollLoadGap</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>The scroll gap is the amount of scrolling that is left to go before
DataTables will load the next 'page' of data automatically. You typically
want a gap which is big enough that the scrolling will be smooth for the
user, while not so large that it will load more data than need.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iTabIndex">iTabIndex</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>By default DataTables allows keyboard navigation of the table (sorting, paging,
and filtering) by adding a tabindex attribute to the required elements. This
allows you to tab through the controls and press the enter key to activate them.
The tabindex is default 0, meaning that the tab follows the flow of the document.
You can overrule this using this parameter if you wish. Use a value of -1 to
disable built-in keyboard navigation.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sAjaxDataProp">sAjaxDataProp</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>By default DataTables will look for the property 'aaData' when obtaining
data from an Ajax source or for server-side processing - this parameter
allows that property to be changed. You can use Javascript dotted object
notation to get a data source for multiple levels of nesting.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sAjaxSource">sAjaxSource</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>You can instruct DataTables to load data from an external source using this
parameter (use aData if you want to pass data in you already have). Simply
provide a url a JSON object can be obtained from. This object must include
the parameter 'aaData' which is the data source for the table.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sCookiePrefix">sCookiePrefix</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>This parameter can be used to override the default prefix that DataTables
assigns to a cookie when state saving is enabled.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sDom">sDom</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>This initialisation variable allows you to specify exactly where in the
DOM you want DataTables to inject the various controls it adds to the page
(for example you might want the pagination controls at the top of the
table). DIV elements (with or without a custom class) can also be added to
aid styling. The follow syntax is used:
<ul>
<li>The following options are allowed: <br />
<ul>
<li>'l' - Length changing</li
<li>'f' - Filtering input</li>
<li>'t' - The table!</li>
<li>'i' - Information</li>
<li>'p' - Pagination</li>
<li>'r' - pRocessing</li>
</ul>
</li>
<li>The following constants are allowed:
<ul>
<li>'H' - jQueryUI theme "header" classes ('fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')</li>
<li>'F' - jQueryUI theme "footer" classes ('fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')</li>
</ul>
</li>
<li>The following syntax is expected:
<ul>
<li>'<' and '>' - div elements</li>
<li>'<"class" and '>' - div with a class</li>
<li>'<"#id" and '>' - div with an ID</li>
</ul>
</li>
<li>Examples:
<ul>
<li>'<"wrapper"flipt>'</li>
<li>'<lf<t>ip>'</li>
</ul>
</li>
</ul></p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sPaginationType">sPaginationType</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>DataTables features two different built-in pagination interaction methods
('two_button' or 'full_numbers') which present different page controls to
the end user. Further methods can be added using the API (see below).</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sScrollX">sScrollX</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>Enable horizontal scrolling. When a table is too wide to fit into a certain
layout, or you have a large number of columns in the table, you can enable
x-scrolling to show the table in a viewport, which can be scrolled. This
property can be any CSS unit, or a number (in which case it will be treated
as a pixel measurement).</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sScrollXInner">sScrollXInner</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>This property can be used to force a DataTable to use more width than it
might otherwise do when x-scrolling is enabled. For example if you have a
table which requires to be well spaced, this parameter is useful for
"over-sizing" the table, and thus forcing scrolling. This property can by
any CSS unit, or a number (in which case it will be treated as a pixel
measurement).</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sScrollY">sScrollY</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>Enable vertical scrolling. Vertical scrolling will constrain the DataTable
to the given height, and enable scrolling for any data which overflows the
current viewport. This can be used as an alternative to paging to display
a lot of data in a small area (although paging and scrolling can both be
enabled at the same time). This property can be any CSS unit, or a number
(in which case it will be treated as a pixel measurement).</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sServerMethod">sServerMethod</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>Set the HTTP method that is used to make the Ajax call for server-side
processing or Ajax sourced data.</p></dd>
</dl></div>
</div>
<div class="doc_details">
<a name="details"></a>
<h2>Details</h2>
<div class="doc_group"><a name="details_properties"></a><h3 class="subsection-title">Properties - static</h3>
<dl>
<dt class=" even"><a name="aaData"></a><a name="aaData_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aaData">aaData</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>An array of data to use for the table, passed in at initialisation which
will be used in preference to any data which is already in the DOM. This is
particularly useful for constructing tables purely in Javascript, for
example with a custom Ajax call.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Examples</h5>
<div class="example-code">
<pre class="brush: js"> // Using a 2D array data source
$(document).ready( function () {
$('#example').dataTable( {
"aaData": [
['Trident', 'Internet Explorer 4.0', 'Win 95+', 4, 'X'],
['Trident', 'Internet Explorer 5.0', 'Win 95+', 5, 'C'],
],
"aoColumns": [
{ "sTitle": "Engine" },
{ "sTitle": "Browser" },
{ "sTitle": "Platform" },
{ "sTitle": "Version" },
{ "sTitle": "Grade" }
]
} );
} );
</pre>
</div>
<div class="example-code">
<pre class="brush: js"> // Using an array of objects as a data source (mData)
$(document).ready( function () {
$('#example').dataTable( {
"aaData": [
{
"engine": "Trident",
"browser": "Internet Explorer 4.0",
"platform": "Win 95+",
"version": 4,
"grade": "X"
},
{
"engine": "Trident",
"browser": "Internet Explorer 5.0",
"platform": "Win 95+",
"version": 5,
"grade": "C"
}
],
"aoColumns": [
{ "sTitle": "Engine", "mData": "engine" },
{ "sTitle": "Browser", "mData": "browser" },
{ "sTitle": "Platform", "mData": "platform" },
{ "sTitle": "Version", "mData": "version" },
{ "sTitle": "Grade", "mData": "grade" }
]
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="aaSorting"></a><a name="aaSorting_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aaSorting">aaSorting</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>If sorting is enabled, then DataTables will perform a first pass sort on
initialisation. You can define which column(s) the sort is performed upon,
and the sorting direction, with this variable. The aaSorting array should
contain an array for each column to be sorted initially containing the
column's index and a direction string ('asc' or 'desc').</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> // Sort by 3rd column first, and then 4th column
$(document).ready( function() {
$('#example').dataTable( {
"aaSorting": [[2,'asc'], [3,'desc']]
} );
} );
// No initial sorting
$(document).ready( function() {
$('#example').dataTable( {
"aaSorting": []
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="aaSortingFixed"></a><a name="aaSortingFixed_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aaSortingFixed">aaSortingFixed</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>This parameter is basically identical to the aaSorting parameter, but
cannot be overridden by user interaction with the table. What this means
is that you could have a column (visible or hidden) which the sorting will
always be forced on first - any sorting after that (from the user) will
then be performed as required. This can be useful for grouping rows
together.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"aaSortingFixed": [[0,'asc']]
} );
} )</pre>
</div>
</div></dd><dt class=" odd"><a name="aLengthMenu"></a><a name="aLengthMenu_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aLengthMenu">aLengthMenu</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>This parameter allows you to readily specify the entries in the length drop
down menu that DataTables shows when pagination is enabled. It can be
either a 1D array of options which will be used for both the displayed
option and the value, or a 2D array which will use the array in the first
position as the value, and the array in the second position as the
displayed options (useful for language strings such as 'All').</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Examples</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
} );
} );
</pre>
</div>
<div class="example-code">
<pre class="brush: js"> // Setting the default display length as well as length menu
// This is likely to be wanted if you remove the '10' option which
// is the iDisplayLength default.
$(document).ready( function() {
$('#example').dataTable( {
"iDisplayLength": 25,
"aLengthMenu": [[25, 50, 100, -1], [25, 50, 100, "All"]]
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="aoColumnDefs"></a><a name="aoColumnDefs_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aoColumnDefs">aoColumnDefs</a></span><span class="type-sig"><span class="type-signature"></span></span></dt><dd class=" even"><p>Very similar to aoColumns, aoColumnDefs allows you to target a specific
column, multiple columns, or all columns, using the aTargets property of
each object in the array. This allows great flexibility when creating
tables, as the aoColumnDefs arrays can be of any length, targeting the
columns you specifically want. aoColumnDefs may use any of the column
options available: <a href="DataTable.defaults.columns.html">DataTable.defaults.columns</a>, but it <em>must</em>
have aTargets defined in each object in the array. Values in the aTargets
array may be:
<ul>
<li>a string - class name will be matched on the TH for the column</li>
<li>0 or a positive integer - column index counting from the left</li>
<li>a negative integer - column index counting from the right</li>
<li>the string "_all" - all columns (i.e. assign a default)</li>
</ul></p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" odd"><a name="aoColumns"></a><a name="aoColumns_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aoColumns">aoColumns</a></span><span class="type-sig"><span class="type-signature"></span></span></dt><dd class=" odd"><p>The aoColumns option in the initialisation parameter allows you to define
details about the way individual columns behave. For a full list of
column options that can be set, please see
<a href="DataTable.defaults.columns.html">DataTable.defaults.columns</a>. Note that if you use aoColumns to
define your columns, you must have an entry in the array for every single
column that you have in your table (these can be null if you don't which
to specify any options).</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" even"><a name="aoSearchCols"></a><a name="aoSearchCols_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#aoSearchCols">aoSearchCols</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" even"><p>Basically the same as oSearch, this parameter defines the individual column
filtering state at initialisation time. The array must be of the same size
as the number of columns, and each element be an object with the parameters
"sSearch" and "bEscapeRegex" (the latter is optional). 'null' is also
accepted and the default will be used.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"aoSearchCols": [
null,
{ "sSearch": "My filter" },
null,
{ "sSearch": "^[0-9]", "bEscapeRegex": false }
]
} );
} )</pre>
</div>
</div></dd><dt class=" odd"><a name="asStripeClasses"></a><a name="asStripeClasses_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#asStripeClasses">asStripeClasses</a></span><span class="type-sig"><span class="type-signature"> :array</span></span></dt><dd class=" odd"><p>An array of CSS classes that should be applied to displayed rows. This
array may be of any length, and DataTables will apply each class
sequentially, looping when required.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"asStripeClasses": [ 'strip1', 'strip2', 'strip3' ]
} );
} )</pre>
</div>
</div></dd><dt class=" even"><a name="bAutoWidth"></a><a name="bAutoWidth_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bAutoWidth">bAutoWidth</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable automatic column width calculation. This can be disabled
as an optimisation (it takes some time to calculate the widths) if the
tables widths are passed in using aoColumns.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bAutoWidth": false
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="bDeferRender"></a><a name="bDeferRender_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bDeferRender">bDeferRender</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Deferred rendering can provide DataTables with a huge speed boost when you
are using an Ajax or JS data source for the table. This option, when set to
true, will cause DataTables to defer the creation of the table elements for
each row until they are needed for a draw - saving a significant amount of
time.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
var oTable = $('#example').dataTable( {
"sAjaxSource": "sources/arrays.txt",
"bDeferRender": true
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="bDestroy"></a><a name="bDestroy_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bDestroy">bDestroy</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Replace a DataTable which matches the given selector and replace it with
one which has the properties of the new initialisation object passed. If no
table matches the selector, then the new DataTable will be constructed as
per normal.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"sScrollY": "200px",
"bPaginate": false
} );
// Some time later....
$('#example').dataTable( {
"bFilter": false,
"bDestroy": true
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="bFilter"></a><a name="bFilter_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bFilter">bFilter</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Enable or disable filtering of data. Filtering in DataTables is "smart" in
that it allows the end user to input multiple words (space separated) and
will match a row containing those words, even if not in the order that was
specified (this allow matching across multiple columns). Note that if you
wish to use filtering in DataTables this must remain 'true' - to remove the
default filtering input box and retain filtering abilities, please use
<a href="DataTable.defaults.html#sDom">DataTable.defaults.sDom</a>.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bFilter": false
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="bInfo"></a><a name="bInfo_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bInfo">bInfo</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable the table information display. This shows information
about the data that is currently visible on the page, including information
about filtered data if that action is being performed.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bInfo": false
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="bJQueryUI"></a><a name="bJQueryUI_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bJQueryUI">bJQueryUI</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Enable jQuery UI ThemeRoller support (required as ThemeRoller requires some
slightly different and additional mark-up from what DataTables has
traditionally used).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"bJQueryUI": true
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="bLengthChange"></a><a name="bLengthChange_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bLengthChange">bLengthChange</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Allows the end user to select the size of a formatted page from a select
menu (sizes are 10, 25, 50 and 100). Requires pagination (bPaginate).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bLengthChange": false
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="bPaginate"></a><a name="bPaginate_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bPaginate">bPaginate</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Enable or disable pagination.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bPaginate": false
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="bProcessing"></a><a name="bProcessing_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bProcessing">bProcessing</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable the display of a 'processing' indicator when the table is
being processed (e.g. a sort). This is particularly useful for tables with
large amounts of data where it can take a noticeable amount of time to sort
the entries.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bProcessing": true
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="bRetrieve"></a><a name="bRetrieve_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bRetrieve">bRetrieve</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Retrieve the DataTables object for the given selector. Note that if the
table has already been initialised, this parameter will cause DataTables
to simply return the object that has already been set up - it will not take
account of any changes you might have made to the initialisation object
passed to DataTables (setting this parameter to true is an acknowledgement
that you understand this). bDestroy can be used to reinitialise a table if
you need.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
initTable();
tableActions();
} );
function initTable ()
{
return $('#example').dataTable( {
"sScrollY": "200px",
"bPaginate": false,
"bRetrieve": true
} );
}
function tableActions ()
{
var oTable = initTable();
// perform API operations with oTable
}</pre>
</div>
</div></dd><dt class=" even"><a name="bScrollAutoCss"></a><a name="bScrollAutoCss_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bScrollAutoCss">bScrollAutoCss</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Indicate if DataTables should be allowed to set the padding / margin
etc for the scrolling header elements or not. Typically you will want
this.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"bScrollAutoCss": false,
"sScrollY": "200px"
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="bScrollCollapse"></a><a name="bScrollCollapse_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bScrollCollapse">bScrollCollapse</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>When vertical (y) scrolling is enabled, DataTables will force the height of
the table's viewport to the given height at all times (useful for layout).
However, this can look odd when filtering data down to a small data set,
and the footer is left "floating" further down. This parameter (when
enabled) will cause DataTables to collapse the table's viewport down when
the result set will fit within the given Y height.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"sScrollY": "200",
"bScrollCollapse": true
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="bScrollInfinite"></a><a name="bScrollInfinite_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bScrollInfinite">bScrollInfinite</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable infinite scrolling for DataTables (to be used in combination with
sScrollY). Infinite scrolling means that DataTables will continually load
data as a user scrolls through a table, which is very useful for large
dataset. This cannot be used with pagination, which is automatically
disabled. Note - the Scroller extra for DataTables is recommended in
in preference to this option.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"bScrollInfinite": true,
"bScrollCollapse": true,
"sScrollY": "200px"
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="bServerSide"></a><a name="bServerSide_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bServerSide">bServerSide</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Configure DataTables to use server-side processing. Note that the
sAjaxSource parameter must also be given in order to give DataTables a
source to obtain the required data for each draw.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bServerSide": true,
"sAjaxSource": "xhr.php"
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="bSort"></a><a name="bSort_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bSort">bSort</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable sorting of columns. Sorting of individual columns can be
disabled by the "bSortable" option for each column.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bSort": false
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="bSortCellsTop"></a><a name="bSortCellsTop_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bSortCellsTop">bSortCellsTop</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Allows control over whether DataTables should use the top (true) unique
cell that is found for a single column, or the bottom (false - default).
This is useful when using complex headers.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"bSortCellsTop": true
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="bSortClasses"></a><a name="bSortClasses_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bSortClasses">bSortClasses</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Enable or disable the addition of the classes 'sorting_1', 'sorting_2' and
'sorting_3' to the columns which are currently being sorted on. This is
presented as a feature switch as it can increase processing time (while
classes are removed and added) so for large data sets you might want to
turn this off.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bSortClasses": false
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="bStateSave"></a><a name="bStateSave_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#bStateSave">bStateSave</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" odd"><p>Enable or disable state saving. When enabled a cookie will be used to save
table display information such as pagination information, display length,
filtering and sorting. As such when the end user reloads the page the
display display will match what thy had previously set up.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"bStateSave": true
} );
} );</pre>
</div>
</div></dd><dt id="DataTable.defaults.fnCookieCallback" class=" even"><a name="fnCookieCallback"></a><a name="fnCookieCallback_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnCookieCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>Customise the cookie and / or the parameters being stored when using
DataTables with state saving enabled. This function is called whenever
the cookie is modified, and it expects a fully formed cookie string to be
returned. Note that the data object passed in is a Javascript object which
must be converted to a string (JSON.stringify for example).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">sName</td><td class="type type-param">string</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Name of the cookie defined by DataTables</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">oData</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Data to be stored in the cookie</p></td></tr><tr class="even"><td class="number right_border"><div>3</div></td><td class="name">sExpires</td><td class="type type-param">string</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Cookie expires string</p></td></tr><tr class="odd"><td class="number right_border"><div>4</div></td><td class="name">sPath</td><td class="type type-param">string</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Path of the cookie to set</p></td></tr>
</tbody>
</table><h5>Returns:</h5><p class="returns"><p>Cookie formatted string (which should be encoded by
using encodeURIComponent())</p></p><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function () {
$('#example').dataTable( {
"fnCookieCallback": function (sName, oData, sExpires, sPath) {
// Customise oData or sName or whatever else here
return sName + "="+JSON.stringify(oData)+"; expires=" + sExpires +"; path=" + sPath;
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnCreatedRow" class=" odd"><a name="fnCreatedRow"></a><a name="fnCreatedRow_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnCreatedRow</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" odd"><p>This function is called when a TR element is created (and all TD child
elements have been inserted), or registered if using a DOM source, allowing
manipulation of the TR element (adding classes etc).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">nRow</td><td class="type type-param">node</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>"TR" element for the current row</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">aData</td><td class="type type-param">array</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Raw data array for this row</p></td></tr><tr class="even"><td class="number right_border"><div>3</div></td><td class="name">iDataIndex</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>The index of this row in aoData</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"fnCreatedRow": function( nRow, aData, iDataIndex ) {
// Bold the grade for all 'A' grade browsers
if ( aData[4] == "A" )
{
$('td:eq(4)', nRow).html( '<b>A</b>' );
}
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnDrawCallback" class=" even"><a name="fnDrawCallback"></a><a name="fnDrawCallback_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnDrawCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>This function is called on every 'draw' event, and allows you to
dynamically modify any aspect you want about the created DOM.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"fnDrawCallback": function( oSettings ) {
alert( 'DataTables has redrawn the table' );
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnFooterCallback" class=" odd"><a name="fnFooterCallback"></a><a name="fnFooterCallback_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnFooterCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" odd"><p>Identical to fnHeaderCallback() but for the table footer this function
allows you to modify the table footer on every 'draw' even.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">nFoot</td><td class="type type-param">node</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>"TR" element for the footer</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">aData</td><td class="type type-param">array</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Full table data (as derived from the original HTML)</p></td></tr><tr class="even"><td class="number right_border"><div>3</div></td><td class="name">iStart</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Index for the current display starting point in the
display array</p></td></tr><tr class="odd"><td class="number right_border"><div>4</div></td><td class="name">iEnd</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Index for the current display ending point in the
display array</p></td></tr><tr class="even"><td class="number right_border"><div>5</div></td><td class="name">aiDisplay</td><td class="type type-param">array int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Index array to translate the visual position
to the full data array</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"fnFooterCallback": function( nFoot, aData, iStart, iEnd, aiDisplay ) {
nFoot.getElementsByTagName('th')[0].innerHTML = "Starting index is "+iStart;
}
} );
} )</pre>
</div>
</div>
<dt id="DataTable.defaults.fnFormatNumber" class=" even"><a name="fnFormatNumber"></a><a name="fnFormatNumber_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnFormatNumber</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>When rendering large numbers in the information element for the table
(i.e. "Showing 1 to 10 of 57 entries") DataTables will render large numbers
to have a comma separator for the 'thousands' units (e.g. 1 million is
rendered as "1,000,000") to help readability for the end user. This
function will override the default method DataTables uses.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">iIn</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>number to be formatted</p></td></tr>
</tbody>
</table><h5>Returns:</h5><p class="returns"><p>formatted string for DataTables to show the number</p></p><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"fnFormatNumber": function ( iIn ) {
if ( iIn < 1000 ) {
return iIn;
} else {
var
s=(iIn+""),
a=s.split(""), out="",
iLen=s.length;
for ( var i=0 ; i<iLen ; i++ ) {
if ( i%3 === 0 && i !== 0 ) {
out = "'"+out;
}
out = a[iLen-i-1]+out;
}
}
return out;
};
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnHeaderCallback" class=" odd"><a name="fnHeaderCallback"></a><a name="fnHeaderCallback_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnHeaderCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" odd"><p>This function is called on every 'draw' event, and allows you to
dynamically modify the header row. This can be used to calculate and
display useful information about the table.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">nHead</td><td class="type type-param">node</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>"TR" element for the header</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">aData</td><td class="type type-param">array</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Full table data (as derived from the original HTML)</p></td></tr><tr class="even"><td class="number right_border"><div>3</div></td><td class="name">iStart</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Index for the current display starting point in the
display array</p></td></tr><tr class="odd"><td class="number right_border"><div>4</div></td><td class="name">iEnd</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Index for the current display ending point in the
display array</p></td></tr><tr class="even"><td class="number right_border"><div>5</div></td><td class="name">aiDisplay</td><td class="type type-param">array int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Index array to translate the visual position
to the full data array</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"fnHeaderCallback": function( nHead, aData, iStart, iEnd, aiDisplay ) {
nHead.getElementsByTagName('th')[0].innerHTML = "Displaying "+(iEnd-iStart)+" records";
}
} );
} )</pre>
</div>
</div>
<dt id="DataTable.defaults.fnInfoCallback" class=" even"><a name="fnInfoCallback"></a><a name="fnInfoCallback_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnInfoCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>The information element can be used to convey information about the current
state of the table. Although the internationalisation options presented by
DataTables are quite capable of dealing with most customisations, there may
be times where you wish to customise the string further. This callback
allows you to do exactly that.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">iStart</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Starting position in data for the draw</p></td></tr><tr class="even"><td class="number right_border"><div>3</div></td><td class="name">iEnd</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>End position in data for the draw</p></td></tr><tr class="odd"><td class="number right_border"><div>4</div></td><td class="name">iMax</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Total number of rows in the table (regardless of
filtering)</p></td></tr><tr class="even"><td class="number right_border"><div>5</div></td><td class="name">iTotal</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Total number of rows in the data set, after filtering</p></td></tr><tr class="odd"><td class="number right_border"><div>6</div></td><td class="name">sPre</td><td class="type type-param">string</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>The string that DataTables has formatted using it's
own rules</p></td></tr>
</tbody>
</table><h5>Returns:</h5><p class="returns"><p>The string to be displayed in the information element.</p></p><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $('#example').dataTable( {
"fnInfoCallback": function( oSettings, iStart, iEnd, iMax, iTotal, sPre ) {
return iStart +" to "+ iEnd;
}
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnInitComplete" class=" odd"><a name="fnInitComplete"></a><a name="fnInitComplete_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnInitComplete</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" odd"><p>Called when the table has been initialised. Normally DataTables will
initialise sequentially and there will be no need for this function,
however, this does not hold true when using external language information
since that is obtained using an async XHR call.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">json</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>The JSON object request from the server - only
present if client-side Ajax sourced data is used</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"fnInitComplete": function(oSettings, json) {
alert( 'DataTables has finished its initialisation.' );
}
} );
} )</pre>
</div>
</div>
<dt id="DataTable.defaults.fnPreDrawCallback" class=" even"><a name="fnPreDrawCallback"></a><a name="fnPreDrawCallback_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnPreDrawCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>Called at the very start of each table draw and can be used to cancel the
draw by returning false, any other return (including undefined) results in
the full draw occurring).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr>
</tbody>
</table><h5>Returns:</h5><p class="returns"><p>False will cancel the draw, anything else (including no
return) will allow it to complete.</p></p><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"fnPreDrawCallback": function( oSettings ) {
if ( $('#test').val() == 1 ) {
return false;
}
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnRowCallback" class=" odd"><a name="fnRowCallback"></a><a name="fnRowCallback_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnRowCallback</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" odd"><p>This function allows you to 'post process' each row after it have been
generated for each table draw, but before it is rendered on screen. This
function might be used for setting the row class name etc.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">nRow</td><td class="type type-param">node</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>"TR" element for the current row</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">aData</td><td class="type type-param">array</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Raw data array for this row</p></td></tr><tr class="even"><td class="number right_border"><div>3</div></td><td class="name">iDisplayIndex</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>The display index for the current table draw</p></td></tr><tr class="odd"><td class="number right_border"><div>4</div></td><td class="name">iDisplayIndexFull</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>The index of the data in the full list of
rows (after filtering)</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
// Bold the grade for all 'A' grade browsers
if ( aData[4] == "A" )
{
$('td:eq(4)', nRow).html( '<b>A</b>' );
}
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnServerData" class=" even"><a name="fnServerData"></a><a name="fnServerData_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnServerData</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>This parameter allows you to override the default function which obtains
the data from the server ($.getJSON) so something more suitable for your
application. For example you could use POST data, or pull information from
a Gears or AIR database.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">sSource</td><td class="type type-param">string</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>HTTP source to obtain the data from (sAjaxSource)</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">aoData</td><td class="type type-param">array</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>A key/value pair object containing the data to send
to the server</p></td></tr><tr class="even"><td class="number right_border"><div>3</div></td><td class="name">fnCallback</td><td class="type type-param">function</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>to be called on completion of the data get
process that will draw the data on the page.</p></td></tr><tr class="odd"><td class="number right_border"><div>4</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> // POST data to server
$(document).ready( function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "xhr.php",
"fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
oSettings.jqXHR = $.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnServerParams" class=" odd"><a name="fnServerParams"></a><a name="fnServerParams_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnServerParams</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" odd"><p>It is often useful to send extra data to the server when making an Ajax
request - for example custom filtering information, and this callback
function makes it trivial to send extra information to the server. The
passed in parameter is the data set that has been constructed by
DataTables, and you can add to this or modify it as you require.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">aoData</td><td class="type type-param">array</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Data array (array of objects which are name/value
pairs) that has been constructed by DataTables and will be sent to the
server. In the case of Ajax sourced data with server-side processing
this will be an empty array, for server-side processing there will be a
significant number of parameters!</p></td></tr>
</tbody>
</table><h5>Returns:</h5><p class="returns"><p>Ensure that you modify the aoData array passed in,
as this is passed by reference.</p></p><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "more_data", "value": "my_value" } );
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnStateLoad" class=" even"><a name="fnStateLoad"></a><a name="fnStateLoad_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnStateLoad</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>Load the table state. With this function you can define from where, and how, the
state of a table is loaded. By default DataTables will load from its state saving
cookie, but you might wish to use local storage (HTML5) or a server-side database.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr>
</tbody>
</table><h5>Returns:</h5><p class="returns"><p>The DataTables state object to be loaded</p></p><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"bStateSave": true,
"fnStateLoad": function (oSettings) {
var o;
// Send an Ajax request to the server to get the data. Note that
// this is a synchronous request.
$.ajax( {
"url": "/state_load",
"async": false,
"dataType": "json",
"success": function (json) {
o = json;
}
} );
return o;
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnStateLoaded" class=" odd"><a name="fnStateLoaded"></a><a name="fnStateLoaded_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnStateLoaded</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" odd"><p>Callback that is called when the state has been loaded from the state saving method
and the DataTables settings object has been modified as a result of the loaded state.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">oData</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>The state object that was loaded</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> // Show an alert with the filtering value that was saved
$(document).ready( function() {
$('#example').dataTable( {
"bStateSave": true,
"fnStateLoaded": function (oSettings, oData) {
alert( 'Saved filter was: '+oData.oSearch.sSearch );
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnStateLoadParams" class=" even"><a name="fnStateLoadParams"></a><a name="fnStateLoadParams_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnStateLoadParams</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>Callback which allows modification of the saved state prior to loading that state.
This callback is called when the table is loading state from the stored data, but
prior to the settings object being modified by the saved state. Note that for
plug-in authors, you should use the 'stateLoadParams' event to load parameters for
a plug-in.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">oData</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>The state object that is to be loaded</p></td></tr>
</tbody>
</table><h5>Examples:</h5>
<div class="example-code">
<pre class="brush: js"> // Remove a saved filter, so filtering is never loaded
$(document).ready( function() {
$('#example').dataTable( {
"bStateSave": true,
"fnStateLoadParams": function (oSettings, oData) {
oData.oSearch.sSearch = "";
}
} );
} );
</pre>
</div>
<div class="example-code">
<pre class="brush: js"> // Disallow state loading by returning false
$(document).ready( function() {
$('#example').dataTable( {
"bStateSave": true,
"fnStateLoadParams": function (oSettings, oData) {
return false;
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnStateSave" class=" odd"><a name="fnStateSave"></a><a name="fnStateSave_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnStateSave</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" odd"><p>Save the table state. This function allows you to define where and how the state
information for the table is stored - by default it will use a cookie, but you
might want to use local storage (HTML5) or a server-side database.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">oData</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>The state object to be saved</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"bStateSave": true,
"fnStateSave": function (oSettings, oData) {
// Send an Ajax request to the server with the state object
$.ajax( {
"url": "/state_save",
"data": oData,
"dataType": "json",
"method": "POST"
"success": function () {}
} );
}
} );
} );</pre>
</div>
</div>
<dt id="DataTable.defaults.fnStateSaveParams" class=" even"><a name="fnStateSaveParams"></a><a name="fnStateSaveParams_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a>fnStateSaveParams</a></span><span class="type-sig"><span class="type-signature"> :function</span></span></span></dt><dd class=" even"><p>Callback which allows modification of the state to be saved. Called when the table
has changed state a new state save is required. This method allows modification of
the state saving object prior to actually doing the save, including addition or
other state properties or modification. Note that for plug-in authors, you should
use the 'stateSaveParams' event to save parameters for a plug-in.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oSettings</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">oData</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>The state object to be saved</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> // Remove a saved filter, so filtering is never saved
$(document).ready( function() {
$('#example').dataTable( {
"bStateSave": true,
"fnStateSaveParams": function (oSettings, oData) {
oData.oSearch.sSearch = "";
}
} );
} );</pre>
</div>
</div>
<dt class=" odd"><a name="iCookieDuration"></a><a name="iCookieDuration_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iCookieDuration">iCookieDuration</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Duration of the cookie which is used for storing session information. This
value is given in seconds.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"iCookieDuration": 60*60*24; // 1 day
} );
} )</pre>
</div>
</div></dd><dt class=" even"><a name="iDeferLoading"></a><a name="iDeferLoading_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iDeferLoading">iDeferLoading</a></span><span class="type-sig"><span class="type-signature"> :int|array</span></span></dt><dd class=" even"><p>When enabled DataTables will not make a request to the server for the first
page draw - rather it will use the data already on the page (no sorting etc
will be applied to it), thus saving on an XHR at load time. iDeferLoading
is used to indicate that deferred loading is required, but it is also used
to tell DataTables how many records there are in the full table (allowing
the information element and pagination to be displayed correctly). In the case
where a filtering is applied to the table on initial load, this can be
indicated by giving the parameter as an array, where the first element is
the number of records available after filtering and the second element is the
number of records without filtering (allowing the table information element
to be shown correctly).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Examples</h5>
<div class="example-code">
<pre class="brush: js"> // 57 records available in the table, no filtering applied
$(document).ready( function() {
$('#example').dataTable( {
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php",
"iDeferLoading": 57
} );
} );
</pre>
</div>
<div class="example-code">
<pre class="brush: js"> // 57 records after filtering, 100 without filtering (an initial filter applied)
$(document).ready( function() {
$('#example').dataTable( {
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php",
"iDeferLoading": [ 57, 100 ],
"oSearch": {
"sSearch": "my_filter"
}
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="iDisplayLength"></a><a name="iDisplayLength_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iDisplayLength">iDisplayLength</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Number of rows to display on a single page when using pagination. If
feature enabled (bLengthChange) then the end user will be able to override
this to a custom setting using a pop-up menu.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"iDisplayLength": 50
} );
} )</pre>
</div>
</div></dd><dt class=" even"><a name="iDisplayStart"></a><a name="iDisplayStart_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iDisplayStart">iDisplayStart</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>Define the starting point for data display when using DataTables with
pagination. Note that this parameter is the number of records, rather than
the page number, so if you have 10 records per page and want to start on
the third page, it should be "20".</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"iDisplayStart": 20
} );
} )</pre>
</div>
</div></dd><dt class=" odd"><a name="iScrollLoadGap"></a><a name="iScrollLoadGap_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iScrollLoadGap">iScrollLoadGap</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>The scroll gap is the amount of scrolling that is left to go before
DataTables will load the next 'page' of data automatically. You typically
want a gap which is big enough that the scrolling will be smooth for the
user, while not so large that it will load more data than need.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"bScrollInfinite": true,
"bScrollCollapse": true,
"sScrollY": "200px",
"iScrollLoadGap": 50
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="iTabIndex"></a><a name="iTabIndex_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#iTabIndex">iTabIndex</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>By default DataTables allows keyboard navigation of the table (sorting, paging,
and filtering) by adding a tabindex attribute to the required elements. This
allows you to tab through the controls and press the enter key to activate them.
The tabindex is default 0, meaning that the tab follows the flow of the document.
You can overrule this using this parameter if you wish. Use a value of -1 to
disable built-in keyboard navigation.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"iTabIndex": 1
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="sAjaxDataProp"></a><a name="sAjaxDataProp_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sAjaxDataProp">sAjaxDataProp</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>By default DataTables will look for the property 'aaData' when obtaining
data from an Ajax source or for server-side processing - this parameter
allows that property to be changed. You can use Javascript dotted object
notation to get a data source for multiple levels of nesting.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Examples</h5>
<div class="example-code">
<pre class="brush: js"> // Get data from { "data": [...] }
$(document).ready( function() {
var oTable = $('#example').dataTable( {
"sAjaxSource": "sources/data.txt",
"sAjaxDataProp": "data"
} );
} );
</pre>
</div>
<div class="example-code">
<pre class="brush: js"> // Get data from { "data": { "inner": [...] } }
$(document).ready( function() {
var oTable = $('#example').dataTable( {
"sAjaxSource": "sources/data.txt",
"sAjaxDataProp": "data.inner"
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="sAjaxSource"></a><a name="sAjaxSource_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sAjaxSource">sAjaxSource</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>You can instruct DataTables to load data from an external source using this
parameter (use aData if you want to pass data in you already have). Simply
provide a url a JSON object can be obtained from. This object must include
the parameter 'aaData' which is the data source for the table.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"sAjaxSource": "http://www.sprymedia.co.uk/dataTables/json.php"
} );
} )</pre>
</div>
</div></dd><dt class=" odd"><a name="sCookiePrefix"></a><a name="sCookiePrefix_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sCookiePrefix">sCookiePrefix</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>This parameter can be used to override the default prefix that DataTables
assigns to a cookie when state saving is enabled.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"sCookiePrefix": "my_datatable_",
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="sDom"></a><a name="sDom_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sDom">sDom</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>This initialisation variable allows you to specify exactly where in the
DOM you want DataTables to inject the various controls it adds to the page
(for example you might want the pagination controls at the top of the
table). DIV elements (with or without a custom class) can also be added to
aid styling. The follow syntax is used:
<ul>
<li>The following options are allowed: <br />
<ul>
<li>'l' - Length changing</li
<li>'f' - Filtering input</li>
<li>'t' - The table!</li>
<li>'i' - Information</li>
<li>'p' - Pagination</li>
<li>'r' - pRocessing</li>
</ul>
</li>
<li>The following constants are allowed:
<ul>
<li>'H' - jQueryUI theme "header" classes ('fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix')</li>
<li>'F' - jQueryUI theme "footer" classes ('fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix')</li>
</ul>
</li>
<li>The following syntax is expected:
<ul>
<li>'<' and '>' - div elements</li>
<li>'<"class" and '>' - div with a class</li>
<li>'<"#id" and '>' - div with an ID</li>
</ul>
</li>
<li>Examples:
<ul>
<li>'<"wrapper"flipt>'</li>
<li>'<lf<t>ip>'</li>
</ul>
</li>
</ul></p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"sDom": '<"top"i>rt<"bottom"flp><"clear">'
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="sPaginationType"></a><a name="sPaginationType_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sPaginationType">sPaginationType</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>DataTables features two different built-in pagination interaction methods
('two_button' or 'full_numbers') which present different page controls to
the end user. Further methods can be added using the API (see below).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"sPaginationType": "full_numbers"
} );
} )</pre>
</div>
</div></dd><dt class=" even"><a name="sScrollX"></a><a name="sScrollX_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sScrollX">sScrollX</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>Enable horizontal scrolling. When a table is too wide to fit into a certain
layout, or you have a large number of columns in the table, you can enable
x-scrolling to show the table in a viewport, which can be scrolled. This
property can be any CSS unit, or a number (in which case it will be treated
as a pixel measurement).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"sScrollX": "100%",
"bScrollCollapse": true
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="sScrollXInner"></a><a name="sScrollXInner_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sScrollXInner">sScrollXInner</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>This property can be used to force a DataTable to use more width than it
might otherwise do when x-scrolling is enabled. For example if you have a
table which requires to be well spaced, this parameter is useful for
"over-sizing" the table, and thus forcing scrolling. This property can by
any CSS unit, or a number (in which case it will be treated as a pixel
measurement).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"sScrollX": "100%",
"sScrollXInner": "110%"
} );
} );</pre>
</div>
</div></dd><dt class=" even"><a name="sScrollY"></a><a name="sScrollY_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sScrollY">sScrollY</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" even"><p>Enable vertical scrolling. Vertical scrolling will constrain the DataTable
to the given height, and enable scrolling for any data which overflows the
current viewport. This can be used as an alternative to paging to display
a lot of data in a small area (although paging and scrolling can both be
enabled at the same time). This property can be any CSS unit, or a number
(in which case it will be treated as a pixel measurement).</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"sScrollY": "200px",
"bPaginate": false
} );
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="sServerMethod"></a><a name="sServerMethod_details"></a><span class="type-attr"><span class="type-signature"><static> </span></span><span class="type-name"><a href="#sServerMethod">sServerMethod</a></span><span class="type-sig"><span class="type-signature"> :string</span></span></dt><dd class=" odd"><p>Set the HTTP method that is used to make the Ajax call for server-side
processing or Ajax sourced data.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready( function() {
$('#example').dataTable( {
"bServerSide": true,
"sAjaxSource": "scripts/post.php",
"sServerMethod": "POST"
} );
} );</pre>
</div>
</div></dd>
</dl></div>
</div>
</div>
<div class="fw_footer">
DataTables: Copyright 2008-2012 Allan Jardine, all rights reserved<br>
Documentation generated by <a href="https://github.com/micmath/JSDoc">JSDoc 3</a> on
23th Sep 2012 - 14:27
with the <a href="http://datatables.net/">DataTables</a> template.
</div>
</body>
</html>