datatables.net-searchbuilder 1.3.3 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/dataTables.searchBuilder.js +244 -231
- package/js/dataTables.searchBuilder.min.js +4 -148
- package/js/dataTables.searchBuilder.min.mjs +7 -0
- package/js/dataTables.searchBuilder.mjs +3829 -0
- package/package.json +4 -2
- package/types/index.d.ts +1 -1
- package/types/searchBuilder.bootstrap.d.ts +4 -0
- package/types/searchBuilder.bootstrap4.d.ts +4 -0
- package/types/searchBuilder.bootstrap5.d.ts +4 -0
- package/types/searchBuilder.bulma.d.ts +4 -0
- package/types/searchBuilder.dataTables.d.ts +4 -0
- package/types/searchBuilder.foundation.d.ts +4 -0
- package/types/searchBuilder.jqueryui.d.ts +4 -0
- package/types/searchBuilder.semanticui.d.ts +4 -0
- package/types/types.d.ts +81 -22
|
@@ -1,11 +1,51 @@
|
|
|
1
|
-
/*! SearchBuilder 1.
|
|
1
|
+
/*! SearchBuilder 1.4.0
|
|
2
2
|
* ©SpryMedia Ltd - datatables.net/license/mit
|
|
3
3
|
*/
|
|
4
|
+
|
|
5
|
+
(function( factory ){
|
|
6
|
+
if ( typeof define === 'function' && define.amd ) {
|
|
7
|
+
// AMD
|
|
8
|
+
define( ['jquery', 'datatables.net'], function ( $ ) {
|
|
9
|
+
return factory( $, window, document );
|
|
10
|
+
} );
|
|
11
|
+
}
|
|
12
|
+
else if ( typeof exports === 'object' ) {
|
|
13
|
+
// CommonJS
|
|
14
|
+
module.exports = function (root, $) {
|
|
15
|
+
if ( ! root ) {
|
|
16
|
+
// CommonJS environments without a window global must pass a
|
|
17
|
+
// root. This will give an error otherwise
|
|
18
|
+
root = window;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if ( ! $ ) {
|
|
22
|
+
$ = typeof window !== 'undefined' ? // jQuery's factory checks for a global window
|
|
23
|
+
require('jquery') :
|
|
24
|
+
require('jquery')( root );
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if ( ! $.fn.dataTable ) {
|
|
28
|
+
require('datatables.net')(root, $);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
return factory( $, root, root.document );
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Browser
|
|
37
|
+
factory( jQuery, window, document );
|
|
38
|
+
}
|
|
39
|
+
}(function( $, window, document, undefined ) {
|
|
40
|
+
'use strict';
|
|
41
|
+
var DataTable = $.fn.dataTable;
|
|
42
|
+
|
|
43
|
+
|
|
4
44
|
(function () {
|
|
5
45
|
'use strict';
|
|
6
46
|
|
|
7
|
-
var $$
|
|
8
|
-
var dataTable$
|
|
47
|
+
var $$3;
|
|
48
|
+
var dataTable$3;
|
|
9
49
|
function moment() {
|
|
10
50
|
return window.moment;
|
|
11
51
|
}
|
|
@@ -18,8 +58,8 @@
|
|
|
18
58
|
* @param jq the instance of jQuery to be set
|
|
19
59
|
*/
|
|
20
60
|
function setJQuery$2(jq) {
|
|
21
|
-
$$
|
|
22
|
-
dataTable$
|
|
61
|
+
$$3 = jq;
|
|
62
|
+
dataTable$3 = jq.fn.dataTable;
|
|
23
63
|
}
|
|
24
64
|
/**
|
|
25
65
|
* The Criteria class is used within SearchBuilder to represent a search criteria
|
|
@@ -31,12 +71,12 @@
|
|
|
31
71
|
if (depth === void 0) { depth = 1; }
|
|
32
72
|
if (serverData === void 0) { serverData = undefined; }
|
|
33
73
|
// Check that the required version of DataTables is included
|
|
34
|
-
if (!dataTable$
|
|
74
|
+
if (!dataTable$3 || !dataTable$3.versionCheck || !dataTable$3.versionCheck('1.10.0')) {
|
|
35
75
|
throw new Error('SearchPane requires DataTables 1.10 or newer');
|
|
36
76
|
}
|
|
37
|
-
this.classes = $$
|
|
77
|
+
this.classes = $$3.extend(true, {}, Criteria.classes);
|
|
38
78
|
// Get options from user and any extra conditions/column types defined by plug-ins
|
|
39
|
-
this.c = $$
|
|
79
|
+
this.c = $$3.extend(true, {}, Criteria.defaults, $$3.fn.dataTable.ext.searchBuilder, opts);
|
|
40
80
|
var i18n = this.c.i18n;
|
|
41
81
|
this.s = {
|
|
42
82
|
condition: undefined,
|
|
@@ -57,58 +97,58 @@
|
|
|
57
97
|
value: []
|
|
58
98
|
};
|
|
59
99
|
this.dom = {
|
|
60
|
-
buttons: $$
|
|
100
|
+
buttons: $$3('<div/>')
|
|
61
101
|
.addClass(this.classes.buttonContainer),
|
|
62
|
-
condition: $$
|
|
102
|
+
condition: $$3('<select disabled/>')
|
|
63
103
|
.addClass(this.classes.condition)
|
|
64
104
|
.addClass(this.classes.dropDown)
|
|
65
105
|
.addClass(this.classes.italic)
|
|
66
106
|
.attr('autocomplete', 'hacking'),
|
|
67
|
-
conditionTitle: $$
|
|
107
|
+
conditionTitle: $$3('<option value="" disabled selected hidden/>')
|
|
68
108
|
.html(this.s.dt.i18n('searchBuilder.condition', i18n.condition)),
|
|
69
|
-
container: $$
|
|
109
|
+
container: $$3('<div/>')
|
|
70
110
|
.addClass(this.classes.container),
|
|
71
|
-
data: $$
|
|
111
|
+
data: $$3('<select/>')
|
|
72
112
|
.addClass(this.classes.data)
|
|
73
113
|
.addClass(this.classes.dropDown)
|
|
74
114
|
.addClass(this.classes.italic),
|
|
75
|
-
dataTitle: $$
|
|
115
|
+
dataTitle: $$3('<option value="" disabled selected hidden/>')
|
|
76
116
|
.html(this.s.dt.i18n('searchBuilder.data', i18n.data)),
|
|
77
|
-
defaultValue: $$
|
|
117
|
+
defaultValue: $$3('<select disabled/>')
|
|
78
118
|
.addClass(this.classes.value)
|
|
79
119
|
.addClass(this.classes.dropDown)
|
|
80
120
|
.addClass(this.classes.select)
|
|
81
121
|
.addClass(this.classes.italic),
|
|
82
|
-
"delete": $$
|
|
122
|
+
"delete": $$3('<button/>')
|
|
83
123
|
.html(this.s.dt.i18n('searchBuilder.delete', i18n["delete"]))
|
|
84
124
|
.addClass(this.classes["delete"])
|
|
85
125
|
.addClass(this.classes.button)
|
|
86
126
|
.attr('title', this.s.dt.i18n('searchBuilder.deleteTitle', i18n.deleteTitle))
|
|
87
127
|
.attr('type', 'button'),
|
|
88
|
-
inputCont: $$
|
|
128
|
+
inputCont: $$3('<div/>')
|
|
89
129
|
.addClass(this.classes.inputCont),
|
|
90
130
|
// eslint-disable-next-line no-useless-escape
|
|
91
|
-
left: $$
|
|
131
|
+
left: $$3('<button/>')
|
|
92
132
|
.html(this.s.dt.i18n('searchBuilder.left', i18n.left))
|
|
93
133
|
.addClass(this.classes.left)
|
|
94
134
|
.addClass(this.classes.button)
|
|
95
135
|
.attr('title', this.s.dt.i18n('searchBuilder.leftTitle', i18n.leftTitle))
|
|
96
136
|
.attr('type', 'button'),
|
|
97
137
|
// eslint-disable-next-line no-useless-escape
|
|
98
|
-
right: $$
|
|
138
|
+
right: $$3('<button/>')
|
|
99
139
|
.html(this.s.dt.i18n('searchBuilder.right', i18n.right))
|
|
100
140
|
.addClass(this.classes.right)
|
|
101
141
|
.addClass(this.classes.button)
|
|
102
142
|
.attr('title', this.s.dt.i18n('searchBuilder.rightTitle', i18n.rightTitle))
|
|
103
143
|
.attr('type', 'button'),
|
|
104
144
|
value: [
|
|
105
|
-
$$
|
|
145
|
+
$$3('<select disabled/>')
|
|
106
146
|
.addClass(this.classes.value)
|
|
107
147
|
.addClass(this.classes.dropDown)
|
|
108
148
|
.addClass(this.classes.italic)
|
|
109
149
|
.addClass(this.classes.select)
|
|
110
150
|
],
|
|
111
|
-
valueTitle: $$
|
|
151
|
+
valueTitle: $$3('<option value="--valueTitle--" disabled selected hidden/>')
|
|
112
152
|
.html(this.s.dt.i18n('searchBuilder.value', i18n.value))
|
|
113
153
|
};
|
|
114
154
|
// If the greyscale option is selected then add the class to add the grey colour to SearchBuilder
|
|
@@ -121,7 +161,7 @@
|
|
|
121
161
|
val.addClass(this.classes.greyscale);
|
|
122
162
|
}
|
|
123
163
|
}
|
|
124
|
-
$$
|
|
164
|
+
$$3(window).on('resize.dtsb', dataTable$3.util.throttle(function () {
|
|
125
165
|
_this.s.topGroup.trigger('dtsb-redrawLogic');
|
|
126
166
|
}));
|
|
127
167
|
this._buildCriteria();
|
|
@@ -161,9 +201,6 @@
|
|
|
161
201
|
.append(this.dom.data)
|
|
162
202
|
.append(this.dom.condition)
|
|
163
203
|
.append(this.dom.inputCont);
|
|
164
|
-
this.dom.inputCont
|
|
165
|
-
.empty()
|
|
166
|
-
.append(this.dom.value[0]);
|
|
167
204
|
this.setListeners();
|
|
168
205
|
// Trigger the inserted events for the value elements as they are inserted
|
|
169
206
|
if (this.dom.value[0] !== undefined) {
|
|
@@ -362,15 +399,15 @@
|
|
|
362
399
|
var data_1 = this.dom.data;
|
|
363
400
|
this.dom.data.children('option').each(function () {
|
|
364
401
|
if (!foundData &&
|
|
365
|
-
($$
|
|
366
|
-
loadedCriteria.origData && $$
|
|
367
|
-
$$
|
|
402
|
+
($$3(this).text() === loadedCriteria.data ||
|
|
403
|
+
loadedCriteria.origData && $$3(this).prop('origData') === loadedCriteria.origData)) {
|
|
404
|
+
$$3(this).prop('selected', true);
|
|
368
405
|
data_1.removeClass(italic_1);
|
|
369
406
|
foundData = true;
|
|
370
|
-
dataIdx = $$
|
|
407
|
+
dataIdx = $$3(this).val();
|
|
371
408
|
}
|
|
372
409
|
else {
|
|
373
|
-
$$
|
|
410
|
+
$$3(this).removeProp('selected');
|
|
374
411
|
}
|
|
375
412
|
});
|
|
376
413
|
}
|
|
@@ -388,7 +425,7 @@
|
|
|
388
425
|
var options = this.dom.condition.children('option');
|
|
389
426
|
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
390
427
|
for (var i = 0; i < options.length; i++) {
|
|
391
|
-
var option = $$
|
|
428
|
+
var option = $$3(options[i]);
|
|
392
429
|
if (loadedCriteria.condition !== undefined &&
|
|
393
430
|
option.val() === loadedCriteria.condition &&
|
|
394
431
|
typeof loadedCriteria.condition === 'string') {
|
|
@@ -407,7 +444,7 @@
|
|
|
407
444
|
this.dom.condition.removeClass(this.classes.italic);
|
|
408
445
|
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
409
446
|
for (var i = 0; i < options.length; i++) {
|
|
410
|
-
var option = $$
|
|
447
|
+
var option = $$3(options[i]);
|
|
411
448
|
if (option.val() !== this.s.condition) {
|
|
412
449
|
option.removeProp('selected');
|
|
413
450
|
}
|
|
@@ -432,7 +469,7 @@
|
|
|
432
469
|
var options = _this.dom.data.children('option.' + _this.classes.option);
|
|
433
470
|
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
434
471
|
for (var i = 0; i < options.length; i++) {
|
|
435
|
-
var option = $$
|
|
472
|
+
var option = $$3(options[i]);
|
|
436
473
|
if (option.val() === _this.dom.data.val()) {
|
|
437
474
|
_this.dom.data.removeClass(_this.classes.italic);
|
|
438
475
|
option.prop('selected', true);
|
|
@@ -467,7 +504,7 @@
|
|
|
467
504
|
var options = _this.dom.condition.children('option.' + _this.classes.option);
|
|
468
505
|
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
469
506
|
for (var i = 0; i < options.length; i++) {
|
|
470
|
-
var option = $$
|
|
507
|
+
var option = $$3(options[i]);
|
|
471
508
|
if (option.val() === _this.dom.condition.val()) {
|
|
472
509
|
_this.dom.condition.removeClass(_this.classes.italic);
|
|
473
510
|
option.prop('selected', true);
|
|
@@ -608,7 +645,7 @@
|
|
|
608
645
|
}
|
|
609
646
|
this.s.value = [];
|
|
610
647
|
this.dom.value = [
|
|
611
|
-
$$
|
|
648
|
+
$$3('<select disabled/>')
|
|
612
649
|
.addClass(this.classes.value)
|
|
613
650
|
.addClass(this.classes.dropDown)
|
|
614
651
|
.addClass(this.classes.italic)
|
|
@@ -623,7 +660,7 @@
|
|
|
623
660
|
*/
|
|
624
661
|
Criteria.prototype._getOptions = function () {
|
|
625
662
|
var table = this.s.dt;
|
|
626
|
-
return $$
|
|
663
|
+
return $$3.extend(true, {}, Criteria.defaults, table.settings()[0].aoColumns[this.s.dataIdx].searchBuilder);
|
|
627
664
|
};
|
|
628
665
|
/**
|
|
629
666
|
* Populates the condition dropdown
|
|
@@ -647,7 +684,7 @@
|
|
|
647
684
|
}
|
|
648
685
|
// If the column type is still unknown, call a draw to try reading it again
|
|
649
686
|
if (this.s.type === null || this.s.type === undefined) {
|
|
650
|
-
$$
|
|
687
|
+
$$3.fn.dataTable.ext.oApi._fnColumnTypes(this.s.dt.settings()[0]);
|
|
651
688
|
this.s.type = this.s.dt.columns().type().toArray()[column];
|
|
652
689
|
}
|
|
653
690
|
// Enable the condition element
|
|
@@ -691,21 +728,23 @@
|
|
|
691
728
|
// Instead input elements need to be used for these instead
|
|
692
729
|
if (this.s.dt.page.info().serverSide && conditionObj[condition].init === Criteria.initSelect) {
|
|
693
730
|
var col = colInits[column];
|
|
694
|
-
if (this.s.serverData[col.data]) {
|
|
731
|
+
if (this.s.serverData && this.s.serverData[col.data]) {
|
|
695
732
|
conditionObj[condition].init = Criteria.initSelectSSP;
|
|
733
|
+
conditionObj[condition].inputValue = Criteria.inputValueSelect;
|
|
734
|
+
conditionObj[condition].isInputValid = Criteria.isInputValidSelect;
|
|
696
735
|
}
|
|
697
736
|
else {
|
|
698
737
|
conditionObj[condition].init = Criteria.initInput;
|
|
738
|
+
conditionObj[condition].inputValue = Criteria.inputValueInput;
|
|
739
|
+
conditionObj[condition].isInputValid = Criteria.isInputValidInput;
|
|
699
740
|
}
|
|
700
|
-
conditionObj[condition].inputValue = Criteria.inputValueSelect;
|
|
701
|
-
conditionObj[condition].isInputValid = Criteria.isInputValidSelect;
|
|
702
741
|
}
|
|
703
742
|
this.s.conditions[condition] = conditionObj[condition];
|
|
704
743
|
var condName = conditionObj[condition].conditionName;
|
|
705
744
|
if (typeof condName === 'function') {
|
|
706
745
|
condName = condName(this.s.dt, this.c.i18n);
|
|
707
746
|
}
|
|
708
|
-
conditionOpts.push($$
|
|
747
|
+
conditionOpts.push($$3('<option>', {
|
|
709
748
|
text: condName,
|
|
710
749
|
value: condition
|
|
711
750
|
})
|
|
@@ -723,7 +762,7 @@
|
|
|
723
762
|
if (typeof condName === 'function') {
|
|
724
763
|
condName = condName(this.s.dt, this.c.i18n);
|
|
725
764
|
}
|
|
726
|
-
var newOpt = $$
|
|
765
|
+
var newOpt = $$3('<option>', {
|
|
727
766
|
text: condName,
|
|
728
767
|
value: condition
|
|
729
768
|
})
|
|
@@ -815,7 +854,7 @@
|
|
|
815
854
|
col.searchBuilderTitle).replace(/(<([^>]+)>)/ig, '')
|
|
816
855
|
};
|
|
817
856
|
_this.s.dataPoints.push(opt);
|
|
818
|
-
_this.dom.data.append($$
|
|
857
|
+
_this.dom.data.append($$3('<option>', {
|
|
819
858
|
text: opt.text,
|
|
820
859
|
value: opt.index
|
|
821
860
|
})
|
|
@@ -842,7 +881,7 @@
|
|
|
842
881
|
data.origData = col.data;
|
|
843
882
|
}
|
|
844
883
|
});
|
|
845
|
-
var newOpt = $$
|
|
884
|
+
var newOpt = $$3('<option>', {
|
|
846
885
|
text: data.text.replace(/(<([^>]+)>)/ig, ''),
|
|
847
886
|
value: data.index
|
|
848
887
|
})
|
|
@@ -894,7 +933,7 @@
|
|
|
894
933
|
if (children.length > 1) {
|
|
895
934
|
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
|
896
935
|
for (var i = 0; i < children.length; i++) {
|
|
897
|
-
$$
|
|
936
|
+
$$3(children[i]).remove();
|
|
898
937
|
}
|
|
899
938
|
}
|
|
900
939
|
// Find the column with the title matching the data for the criteria and take note of the index
|
|
@@ -1001,14 +1040,14 @@
|
|
|
1001
1040
|
var settings = that.s.dt.settings()[0];
|
|
1002
1041
|
that.dom.valueTitle.prop('selected', true);
|
|
1003
1042
|
// Declare select element to be used with all of the default classes and listeners.
|
|
1004
|
-
var el = $$
|
|
1043
|
+
var el = $$3('<select/>')
|
|
1005
1044
|
.addClass(Criteria.classes.value)
|
|
1006
1045
|
.addClass(Criteria.classes.dropDown)
|
|
1007
1046
|
.addClass(Criteria.classes.italic)
|
|
1008
1047
|
.addClass(Criteria.classes.select)
|
|
1009
1048
|
.append(that.dom.valueTitle)
|
|
1010
1049
|
.on('change.dtsb', function () {
|
|
1011
|
-
$$
|
|
1050
|
+
$$3(this).removeClass(Criteria.classes.italic);
|
|
1012
1051
|
fn(that, this);
|
|
1013
1052
|
});
|
|
1014
1053
|
if (that.c.greyscale) {
|
|
@@ -1043,7 +1082,7 @@
|
|
|
1043
1082
|
filt.replace(/(<([^>]+)>)/ig, '');
|
|
1044
1083
|
}
|
|
1045
1084
|
// Add text and value, stripping out any html if that is the column type
|
|
1046
|
-
var opt = $$
|
|
1085
|
+
var opt = $$3('<option>', {
|
|
1047
1086
|
type: Array.isArray(filt) ? 'Array' : 'String',
|
|
1048
1087
|
value: filt
|
|
1049
1088
|
})
|
|
@@ -1132,14 +1171,14 @@
|
|
|
1132
1171
|
if (preDefined === void 0) { preDefined = null; }
|
|
1133
1172
|
that.dom.valueTitle.prop('selected', true);
|
|
1134
1173
|
// Declare select element to be used with all of the default classes and listeners.
|
|
1135
|
-
var el = $$
|
|
1174
|
+
var el = $$3('<select/>')
|
|
1136
1175
|
.addClass(Criteria.classes.value)
|
|
1137
1176
|
.addClass(Criteria.classes.dropDown)
|
|
1138
1177
|
.addClass(Criteria.classes.italic)
|
|
1139
1178
|
.addClass(Criteria.classes.select)
|
|
1140
1179
|
.append(that.dom.valueTitle)
|
|
1141
1180
|
.on('change.dtsb', function () {
|
|
1142
|
-
$$
|
|
1181
|
+
$$3(this).removeClass(Criteria.classes.italic);
|
|
1143
1182
|
fn(that, this);
|
|
1144
1183
|
});
|
|
1145
1184
|
if (that.c.greyscale) {
|
|
@@ -1156,7 +1195,7 @@
|
|
|
1156
1195
|
filt.replace(/(<([^>]+)>)/ig, '');
|
|
1157
1196
|
}
|
|
1158
1197
|
// Add text and value, stripping out any html if that is the column type
|
|
1159
|
-
var opt = $$
|
|
1198
|
+
var opt = $$3('<option>', {
|
|
1160
1199
|
type: Array.isArray(filt) ? 'Array' : 'String',
|
|
1161
1200
|
value: filt
|
|
1162
1201
|
})
|
|
@@ -1199,7 +1238,7 @@
|
|
|
1199
1238
|
if (preDefined === void 0) { preDefined = null; }
|
|
1200
1239
|
// Declare the input element
|
|
1201
1240
|
var searchDelay = that.s.dt.settings()[0].searchDelay;
|
|
1202
|
-
var el = $$
|
|
1241
|
+
var el = $$3('<input/>')
|
|
1203
1242
|
.addClass(Criteria.classes.value)
|
|
1204
1243
|
.addClass(Criteria.classes.input)
|
|
1205
1244
|
.on('input.dtsb keypress.dtsb', that._throttle(function (e) {
|
|
@@ -1227,17 +1266,17 @@
|
|
|
1227
1266
|
// Declare all of the necessary jQuery elements
|
|
1228
1267
|
var searchDelay = that.s.dt.settings()[0].searchDelay;
|
|
1229
1268
|
var els = [
|
|
1230
|
-
$$
|
|
1269
|
+
$$3('<input/>')
|
|
1231
1270
|
.addClass(Criteria.classes.value)
|
|
1232
1271
|
.addClass(Criteria.classes.input)
|
|
1233
1272
|
.on('input.dtsb keypress.dtsb', that._throttle(function (e) {
|
|
1234
1273
|
var code = e.keyCode || e.which;
|
|
1235
1274
|
return fn(that, this, code);
|
|
1236
1275
|
}, searchDelay === null ? 100 : searchDelay)),
|
|
1237
|
-
$$
|
|
1276
|
+
$$3('<span>')
|
|
1238
1277
|
.addClass(that.classes.joiner)
|
|
1239
1278
|
.html(that.s.dt.i18n('searchBuilder.valueJoiner', that.c.i18n.valueJoiner)),
|
|
1240
|
-
$$
|
|
1279
|
+
$$3('<input/>')
|
|
1241
1280
|
.addClass(Criteria.classes.value)
|
|
1242
1281
|
.addClass(Criteria.classes.input)
|
|
1243
1282
|
.on('input.dtsb keypress.dtsb', that._throttle(function (e) {
|
|
@@ -1267,7 +1306,7 @@
|
|
|
1267
1306
|
if (preDefined === void 0) { preDefined = null; }
|
|
1268
1307
|
var searchDelay = that.s.dt.settings()[0].searchDelay;
|
|
1269
1308
|
// Declare date element using DataTables dateTime plugin
|
|
1270
|
-
var el = $$
|
|
1309
|
+
var el = $$3('<input/>')
|
|
1271
1310
|
.addClass(Criteria.classes.value)
|
|
1272
1311
|
.addClass(Criteria.classes.input)
|
|
1273
1312
|
.dtDateTime({
|
|
@@ -1308,7 +1347,7 @@
|
|
|
1308
1347
|
var searchDelay = that.s.dt.settings()[0].searchDelay;
|
|
1309
1348
|
// Declare all of the date elements that are required using DataTables dateTime plugin
|
|
1310
1349
|
var els = [
|
|
1311
|
-
$$
|
|
1350
|
+
$$3('<input/>')
|
|
1312
1351
|
.addClass(Criteria.classes.value)
|
|
1313
1352
|
.addClass(Criteria.classes.input)
|
|
1314
1353
|
.dtDateTime({
|
|
@@ -1328,10 +1367,10 @@
|
|
|
1328
1367
|
return fn(that, this, code);
|
|
1329
1368
|
}, searchDelay === null ? 0 : searchDelay);
|
|
1330
1369
|
}),
|
|
1331
|
-
$$
|
|
1370
|
+
$$3('<span>')
|
|
1332
1371
|
.addClass(that.classes.joiner)
|
|
1333
1372
|
.html(that.s.dt.i18n('searchBuilder.valueJoiner', that.c.i18n.valueJoiner)),
|
|
1334
|
-
$$
|
|
1373
|
+
$$3('<input/>')
|
|
1335
1374
|
.addClass(Criteria.classes.value)
|
|
1336
1375
|
.addClass(Criteria.classes.input)
|
|
1337
1376
|
.dtDateTime({
|
|
@@ -2435,16 +2474,16 @@
|
|
|
2435
2474
|
return Criteria;
|
|
2436
2475
|
}());
|
|
2437
2476
|
|
|
2438
|
-
var $$
|
|
2439
|
-
var dataTable$
|
|
2477
|
+
var $$2;
|
|
2478
|
+
var dataTable$2;
|
|
2440
2479
|
/**
|
|
2441
2480
|
* Sets the value of jQuery for use in the file
|
|
2442
2481
|
*
|
|
2443
2482
|
* @param jq the instance of jQuery to be set
|
|
2444
2483
|
*/
|
|
2445
2484
|
function setJQuery$1(jq) {
|
|
2446
|
-
$$
|
|
2447
|
-
dataTable$
|
|
2485
|
+
$$2 = jq;
|
|
2486
|
+
dataTable$2 = jq.fn.dataTable;
|
|
2448
2487
|
}
|
|
2449
2488
|
/**
|
|
2450
2489
|
* The Group class is used within SearchBuilder to represent a group of criteria
|
|
@@ -2456,12 +2495,12 @@
|
|
|
2456
2495
|
if (depth === void 0) { depth = 1; }
|
|
2457
2496
|
if (serverData === void 0) { serverData = undefined; }
|
|
2458
2497
|
// Check that the required version of DataTables is included
|
|
2459
|
-
if (!dataTable$
|
|
2498
|
+
if (!dataTable$2 || !dataTable$2.versionCheck || !dataTable$2.versionCheck('1.10.0')) {
|
|
2460
2499
|
throw new Error('SearchBuilder requires DataTables 1.10 or newer');
|
|
2461
2500
|
}
|
|
2462
|
-
this.classes = $$
|
|
2501
|
+
this.classes = $$2.extend(true, {}, Group.classes);
|
|
2463
2502
|
// Get options from user
|
|
2464
|
-
this.c = $$
|
|
2503
|
+
this.c = $$2.extend(true, {}, Group.defaults, opts);
|
|
2465
2504
|
this.s = {
|
|
2466
2505
|
criteria: [],
|
|
2467
2506
|
depth: depth,
|
|
@@ -2476,21 +2515,21 @@
|
|
|
2476
2515
|
topGroup: topGroup
|
|
2477
2516
|
};
|
|
2478
2517
|
this.dom = {
|
|
2479
|
-
add: $$
|
|
2518
|
+
add: $$2('<button/>')
|
|
2480
2519
|
.addClass(this.classes.add)
|
|
2481
2520
|
.addClass(this.classes.button)
|
|
2482
2521
|
.attr('type', 'button'),
|
|
2483
|
-
clear: $$
|
|
2522
|
+
clear: $$2('<button>×</button>')
|
|
2484
2523
|
.addClass(this.classes.button)
|
|
2485
2524
|
.addClass(this.classes.clearGroup)
|
|
2486
2525
|
.attr('type', 'button'),
|
|
2487
|
-
container: $$
|
|
2526
|
+
container: $$2('<div/>')
|
|
2488
2527
|
.addClass(this.classes.group),
|
|
2489
|
-
logic: $$
|
|
2528
|
+
logic: $$2('<button><div/></button>')
|
|
2490
2529
|
.addClass(this.classes.logic)
|
|
2491
2530
|
.addClass(this.classes.button)
|
|
2492
2531
|
.attr('type', 'button'),
|
|
2493
|
-
logicContainer: $$
|
|
2532
|
+
logicContainer: $$2('<div/>')
|
|
2494
2533
|
.addClass(this.classes.logicContainer)
|
|
2495
2534
|
};
|
|
2496
2535
|
// A reference to the top level group is maintained throughout any subgroups and criteria that may be created
|
|
@@ -2705,7 +2744,7 @@
|
|
|
2705
2744
|
// Set vertical alignment
|
|
2706
2745
|
var firstCrit = this.dom.logicContainer.next();
|
|
2707
2746
|
var currentTop = logicOffset.top;
|
|
2708
|
-
var firstTop = $$
|
|
2747
|
+
var firstTop = $$2(firstCrit).offset().top;
|
|
2709
2748
|
var shuffleTop = currentTop - firstTop;
|
|
2710
2749
|
var newTop = currentTop - shuffleTop;
|
|
2711
2750
|
this.dom.logicContainer.offset({ top: newTop });
|
|
@@ -3174,16 +3213,16 @@
|
|
|
3174
3213
|
return Group;
|
|
3175
3214
|
}());
|
|
3176
3215
|
|
|
3177
|
-
var
|
|
3178
|
-
var dataTable;
|
|
3216
|
+
var $$1;
|
|
3217
|
+
var dataTable$1;
|
|
3179
3218
|
/**
|
|
3180
3219
|
* Sets the value of jQuery for use in the file
|
|
3181
3220
|
*
|
|
3182
3221
|
* @param jq the instance of jQuery to be set
|
|
3183
3222
|
*/
|
|
3184
3223
|
function setJQuery(jq) {
|
|
3185
|
-
|
|
3186
|
-
dataTable = jq.fn.DataTable;
|
|
3224
|
+
$$1 = jq;
|
|
3225
|
+
dataTable$1 = jq.fn.DataTable;
|
|
3187
3226
|
}
|
|
3188
3227
|
/**
|
|
3189
3228
|
* SearchBuilder class for DataTables.
|
|
@@ -3193,23 +3232,23 @@
|
|
|
3193
3232
|
function SearchBuilder(builderSettings, opts) {
|
|
3194
3233
|
var _this = this;
|
|
3195
3234
|
// Check that the required version of DataTables is included
|
|
3196
|
-
if (!dataTable || !dataTable.versionCheck || !dataTable.versionCheck('1.10.0')) {
|
|
3235
|
+
if (!dataTable$1 || !dataTable$1.versionCheck || !dataTable$1.versionCheck('1.10.0')) {
|
|
3197
3236
|
throw new Error('SearchBuilder requires DataTables 1.10 or newer');
|
|
3198
3237
|
}
|
|
3199
|
-
var table = new dataTable.Api(builderSettings);
|
|
3200
|
-
this.classes =
|
|
3238
|
+
var table = new dataTable$1.Api(builderSettings);
|
|
3239
|
+
this.classes = $$1.extend(true, {}, SearchBuilder.classes);
|
|
3201
3240
|
// Get options from user
|
|
3202
|
-
this.c =
|
|
3241
|
+
this.c = $$1.extend(true, {}, SearchBuilder.defaults, opts);
|
|
3203
3242
|
this.dom = {
|
|
3204
|
-
clearAll:
|
|
3243
|
+
clearAll: $$1('<button type="button">' + table.i18n('searchBuilder.clearAll', this.c.i18n.clearAll) + '</button>')
|
|
3205
3244
|
.addClass(this.classes.clearAll)
|
|
3206
3245
|
.addClass(this.classes.button)
|
|
3207
3246
|
.attr('type', 'button'),
|
|
3208
|
-
container:
|
|
3247
|
+
container: $$1('<div/>')
|
|
3209
3248
|
.addClass(this.classes.container),
|
|
3210
|
-
title:
|
|
3249
|
+
title: $$1('<div/>')
|
|
3211
3250
|
.addClass(this.classes.title),
|
|
3212
|
-
titleRow:
|
|
3251
|
+
titleRow: $$1('<div/>')
|
|
3213
3252
|
.addClass(this.classes.titleRow),
|
|
3214
3253
|
topGroup: undefined
|
|
3215
3254
|
};
|
|
@@ -3325,14 +3364,14 @@
|
|
|
3325
3364
|
var _this = this;
|
|
3326
3365
|
if (loadState === void 0) { loadState = true; }
|
|
3327
3366
|
// Register an Api method for getting the column type
|
|
3328
|
-
|
|
3367
|
+
$$1.fn.DataTable.Api.registerPlural('columns().type()', 'column().type()', function () {
|
|
3329
3368
|
return this.iterator('column', function (settings, column) {
|
|
3330
3369
|
return settings.aoColumns[column].sType;
|
|
3331
3370
|
}, 1);
|
|
3332
3371
|
});
|
|
3333
3372
|
// Check that DateTime is included, If not need to check if it could be used
|
|
3334
3373
|
// eslint-disable-next-line no-extra-parens
|
|
3335
|
-
if (!dataTable.DateTime) {
|
|
3374
|
+
if (!dataTable$1.DateTime) {
|
|
3336
3375
|
var types = this.s.dt.columns().type().toArray();
|
|
3337
3376
|
if (types === undefined || types.includes(undefined) || types.includes(null)) {
|
|
3338
3377
|
types = [];
|
|
@@ -3344,7 +3383,7 @@
|
|
|
3344
3383
|
var columnIdxs = this.s.dt.columns().toArray();
|
|
3345
3384
|
// If the types are not yet set then draw to see if they can be retrieved then
|
|
3346
3385
|
if (types === undefined || types.includes(undefined) || types.includes(null)) {
|
|
3347
|
-
|
|
3386
|
+
$$1.fn.dataTable.ext.oApi._fnColumnTypes(this.s.dt.settings()[0]);
|
|
3348
3387
|
types = this.s.dt.columns().type().toArray();
|
|
3349
3388
|
}
|
|
3350
3389
|
for (var i = 0; i < columnIdxs[0].length; i++) {
|
|
@@ -3467,7 +3506,7 @@
|
|
|
3467
3506
|
this.dom.container.append(this.dom.topGroup);
|
|
3468
3507
|
this._setRedrawListener();
|
|
3469
3508
|
var tableNode = this.s.dt.table(0).node();
|
|
3470
|
-
if (
|
|
3509
|
+
if (!$$1.fn.dataTable.ext.search.includes(this.s.search)) {
|
|
3471
3510
|
// Custom search function for SearchBuilder
|
|
3472
3511
|
this.s.search = function (settings, searchData, dataIndex) {
|
|
3473
3512
|
if (settings.nTable !== tableNode) {
|
|
@@ -3476,18 +3515,18 @@
|
|
|
3476
3515
|
return _this.s.topGroup.search(searchData, dataIndex);
|
|
3477
3516
|
};
|
|
3478
3517
|
// Add SearchBuilder search function to the dataTables search array
|
|
3479
|
-
|
|
3518
|
+
$$1.fn.dataTable.ext.search.push(this.s.search);
|
|
3480
3519
|
}
|
|
3481
3520
|
this.s.dt.on('destroy.dtsb', function () {
|
|
3482
3521
|
_this.dom.container.remove();
|
|
3483
3522
|
_this.dom.clearAll.remove();
|
|
3484
|
-
var searchIdx =
|
|
3523
|
+
var searchIdx = $$1.fn.dataTable.ext.search.indexOf(_this.s.search);
|
|
3485
3524
|
while (searchIdx !== -1) {
|
|
3486
|
-
|
|
3487
|
-
searchIdx =
|
|
3525
|
+
$$1.fn.dataTable.ext.search.splice(searchIdx, 1);
|
|
3526
|
+
searchIdx = $$1.fn.dataTable.ext.search.indexOf(_this.s.search);
|
|
3488
3527
|
}
|
|
3489
3528
|
_this.s.dt.off('.dtsb');
|
|
3490
|
-
|
|
3529
|
+
$$1(_this.s.dt.table().node()).off('.dtsb');
|
|
3491
3530
|
});
|
|
3492
3531
|
};
|
|
3493
3532
|
/**
|
|
@@ -3598,7 +3637,7 @@
|
|
|
3598
3637
|
_this.dom.clearAll.remove();
|
|
3599
3638
|
});
|
|
3600
3639
|
};
|
|
3601
|
-
SearchBuilder.version = '1.
|
|
3640
|
+
SearchBuilder.version = '1.4.0';
|
|
3602
3641
|
SearchBuilder.classes = {
|
|
3603
3642
|
button: 'dtsb-button',
|
|
3604
3643
|
clearAll: 'dtsb-clearAll',
|
|
@@ -3704,149 +3743,123 @@
|
|
|
3704
3743
|
return SearchBuilder;
|
|
3705
3744
|
}());
|
|
3706
3745
|
|
|
3707
|
-
/*! SearchBuilder 1.
|
|
3746
|
+
/*! SearchBuilder 1.4.0
|
|
3708
3747
|
* ©SpryMedia Ltd - datatables.net/license/mit
|
|
3709
3748
|
*/
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3749
|
+
setJQuery($);
|
|
3750
|
+
setJQuery$1($);
|
|
3751
|
+
setJQuery$2($);
|
|
3752
|
+
var dataTable = $.fn.dataTable;
|
|
3753
|
+
// eslint-disable-next-line no-extra-parens
|
|
3754
|
+
DataTable.SearchBuilder = SearchBuilder;
|
|
3755
|
+
// eslint-disable-next-line no-extra-parens
|
|
3756
|
+
dataTable.SearchBuilder = SearchBuilder;
|
|
3757
|
+
// eslint-disable-next-line no-extra-parens
|
|
3758
|
+
DataTable.Group = Group;
|
|
3759
|
+
// eslint-disable-next-line no-extra-parens
|
|
3760
|
+
dataTable.Group = Group;
|
|
3761
|
+
// eslint-disable-next-line no-extra-parens
|
|
3762
|
+
DataTable.Criteria = Criteria;
|
|
3763
|
+
// eslint-disable-next-line no-extra-parens
|
|
3764
|
+
dataTable.Criteria = Criteria;
|
|
3765
|
+
// eslint-disable-next-line no-extra-parens
|
|
3766
|
+
var apiRegister = DataTable.Api.register;
|
|
3767
|
+
// Set up object for plugins
|
|
3768
|
+
DataTable.ext.searchBuilder = {
|
|
3769
|
+
conditions: {}
|
|
3770
|
+
};
|
|
3771
|
+
DataTable.ext.buttons.searchBuilder = {
|
|
3772
|
+
action: function (e, dt, node, config) {
|
|
3773
|
+
this.popover(config._searchBuilder.getNode(), {
|
|
3774
|
+
align: 'container',
|
|
3775
|
+
span: 'container'
|
|
3718
3776
|
});
|
|
3777
|
+
var topGroup = config._searchBuilder.s.topGroup;
|
|
3778
|
+
// Need to redraw the contents to calculate the correct positions for the elements
|
|
3779
|
+
if (topGroup !== undefined) {
|
|
3780
|
+
topGroup.dom.container.trigger('dtsb-redrawContents-noDraw');
|
|
3781
|
+
}
|
|
3782
|
+
if (topGroup.s.criteria.length === 0) {
|
|
3783
|
+
$('.' + $.fn.dataTable.Group.classes.add.replace(/ /g, '.')).click();
|
|
3784
|
+
}
|
|
3785
|
+
},
|
|
3786
|
+
config: {},
|
|
3787
|
+
init: function (dt, node, config) {
|
|
3788
|
+
var sb = new DataTable.SearchBuilder(dt, $.extend({
|
|
3789
|
+
filterChanged: function (count, text) {
|
|
3790
|
+
dt.button(node).text(text);
|
|
3791
|
+
}
|
|
3792
|
+
}, config.config));
|
|
3793
|
+
dt.button(node).text(config.text || dt.i18n('searchBuilder.button', sb.c.i18n.button, 0));
|
|
3794
|
+
config._searchBuilder = sb;
|
|
3795
|
+
},
|
|
3796
|
+
text: null
|
|
3797
|
+
};
|
|
3798
|
+
apiRegister('searchBuilder.getDetails()', function (deFormatDates) {
|
|
3799
|
+
if (deFormatDates === void 0) { deFormatDates = false; }
|
|
3800
|
+
var ctx = this.context[0];
|
|
3801
|
+
// If SearchBuilder has not been initialised on this instance then return
|
|
3802
|
+
return ctx._searchBuilder ?
|
|
3803
|
+
ctx._searchBuilder.getDetails(deFormatDates) :
|
|
3804
|
+
null;
|
|
3805
|
+
});
|
|
3806
|
+
apiRegister('searchBuilder.rebuild()', function (details) {
|
|
3807
|
+
var ctx = this.context[0];
|
|
3808
|
+
// If SearchBuilder has not been initialised on this instance then return
|
|
3809
|
+
if (ctx._searchBuilder === undefined) {
|
|
3810
|
+
return null;
|
|
3719
3811
|
}
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
var
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
// eslint-disable-next-line no-extra-parens
|
|
3752
|
-
$.fn.dataTable.Criteria = Criteria;
|
|
3753
|
-
// eslint-disable-next-line no-extra-parens
|
|
3754
|
-
$.fn.DataTable.Criteria = Criteria;
|
|
3755
|
-
// eslint-disable-next-line no-extra-parens
|
|
3756
|
-
var apiRegister = $.fn.dataTable.Api.register;
|
|
3757
|
-
// Set up object for plugins
|
|
3758
|
-
$.fn.dataTable.ext.searchBuilder = {
|
|
3759
|
-
conditions: {}
|
|
3760
|
-
};
|
|
3761
|
-
$.fn.dataTable.ext.buttons.searchBuilder = {
|
|
3762
|
-
action: function (e, dt, node, config) {
|
|
3763
|
-
this.popover(config._searchBuilder.getNode(), {
|
|
3764
|
-
align: 'container',
|
|
3765
|
-
span: 'container'
|
|
3766
|
-
});
|
|
3767
|
-
var topGroup = config._searchBuilder.s.topGroup;
|
|
3768
|
-
// Need to redraw the contents to calculate the correct positions for the elements
|
|
3769
|
-
if (topGroup !== undefined) {
|
|
3770
|
-
topGroup.dom.container.trigger('dtsb-redrawContents-noDraw');
|
|
3771
|
-
}
|
|
3772
|
-
if (topGroup.s.criteria.length === 0) {
|
|
3773
|
-
$('.' + $.fn.dataTable.Group.classes.add.replace(/ /g, '.')).click();
|
|
3774
|
-
}
|
|
3775
|
-
},
|
|
3776
|
-
config: {},
|
|
3777
|
-
init: function (dt, node, config) {
|
|
3778
|
-
var sb = new $.fn.dataTable.SearchBuilder(dt, $.extend({
|
|
3779
|
-
filterChanged: function (count, text) {
|
|
3780
|
-
dt.button(node).text(text);
|
|
3781
|
-
}
|
|
3782
|
-
}, config.config));
|
|
3783
|
-
dt.button(node).text(config.text || dt.i18n('searchBuilder.button', sb.c.i18n.button, 0));
|
|
3784
|
-
config._searchBuilder = sb;
|
|
3785
|
-
},
|
|
3786
|
-
text: null
|
|
3787
|
-
};
|
|
3788
|
-
apiRegister('searchBuilder.getDetails()', function (deFormatDates) {
|
|
3789
|
-
if (deFormatDates === void 0) { deFormatDates = false; }
|
|
3790
|
-
var ctx = this.context[0];
|
|
3791
|
-
// If SearchBuilder has not been initialised on this instance then return
|
|
3792
|
-
return ctx._searchBuilder ?
|
|
3793
|
-
ctx._searchBuilder.getDetails(deFormatDates) :
|
|
3794
|
-
null;
|
|
3795
|
-
});
|
|
3796
|
-
apiRegister('searchBuilder.rebuild()', function (details) {
|
|
3797
|
-
var ctx = this.context[0];
|
|
3798
|
-
// If SearchBuilder has not been initialised on this instance then return
|
|
3799
|
-
if (ctx._searchBuilder === undefined) {
|
|
3800
|
-
return null;
|
|
3801
|
-
}
|
|
3802
|
-
ctx._searchBuilder.rebuild(details);
|
|
3803
|
-
return this;
|
|
3804
|
-
});
|
|
3805
|
-
apiRegister('searchBuilder.container()', function () {
|
|
3806
|
-
var ctx = this.context[0];
|
|
3807
|
-
// If SearchBuilder has not been initialised on this instance then return
|
|
3808
|
-
return ctx._searchBuilder ?
|
|
3809
|
-
ctx._searchBuilder.getNode() :
|
|
3810
|
-
null;
|
|
3811
|
-
});
|
|
3812
|
-
/**
|
|
3813
|
-
* Init function for SearchBuilder
|
|
3814
|
-
*
|
|
3815
|
-
* @param settings the settings to be applied
|
|
3816
|
-
* @param options the options for SearchBuilder
|
|
3817
|
-
* @returns JQUERY<HTMLElement> Returns the node of the SearchBuilder
|
|
3818
|
-
*/
|
|
3819
|
-
function _init(settings, options) {
|
|
3820
|
-
var api = new dataTable.Api(settings);
|
|
3821
|
-
var opts = options
|
|
3822
|
-
? options
|
|
3823
|
-
: api.init().searchBuilder || dataTable.defaults.searchBuilder;
|
|
3824
|
-
var searchBuilder = new SearchBuilder(api, opts);
|
|
3825
|
-
var node = searchBuilder.getNode();
|
|
3826
|
-
return node;
|
|
3812
|
+
ctx._searchBuilder.rebuild(details);
|
|
3813
|
+
return this;
|
|
3814
|
+
});
|
|
3815
|
+
apiRegister('searchBuilder.container()', function () {
|
|
3816
|
+
var ctx = this.context[0];
|
|
3817
|
+
// If SearchBuilder has not been initialised on this instance then return
|
|
3818
|
+
return ctx._searchBuilder ?
|
|
3819
|
+
ctx._searchBuilder.getNode() :
|
|
3820
|
+
null;
|
|
3821
|
+
});
|
|
3822
|
+
/**
|
|
3823
|
+
* Init function for SearchBuilder
|
|
3824
|
+
*
|
|
3825
|
+
* @param settings the settings to be applied
|
|
3826
|
+
* @param options the options for SearchBuilder
|
|
3827
|
+
* @returns JQUERY<HTMLElement> Returns the node of the SearchBuilder
|
|
3828
|
+
*/
|
|
3829
|
+
function _init(settings, options) {
|
|
3830
|
+
var api = new DataTable.Api(settings);
|
|
3831
|
+
var opts = options
|
|
3832
|
+
? options
|
|
3833
|
+
: api.init().searchBuilder || DataTable.defaults.searchBuilder;
|
|
3834
|
+
var searchBuilder = new SearchBuilder(api, opts);
|
|
3835
|
+
var node = searchBuilder.getNode();
|
|
3836
|
+
return node;
|
|
3837
|
+
}
|
|
3838
|
+
// Attach a listener to the document which listens for DataTables initialisation
|
|
3839
|
+
// events so we can automatically initialise
|
|
3840
|
+
$(document).on('preInit.dt.dtsp', function (e, settings) {
|
|
3841
|
+
if (e.namespace !== 'dt') {
|
|
3842
|
+
return;
|
|
3827
3843
|
}
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
return;
|
|
3844
|
+
if (settings.oInit.searchBuilder ||
|
|
3845
|
+
DataTable.defaults.searchBuilder) {
|
|
3846
|
+
if (!settings._searchBuilder) {
|
|
3847
|
+
_init(settings);
|
|
3833
3848
|
}
|
|
3834
|
-
if (settings.oInit.searchBuilder ||
|
|
3835
|
-
dataTable.defaults.searchBuilder) {
|
|
3836
|
-
if (!settings._searchBuilder) {
|
|
3837
|
-
_init(settings);
|
|
3838
|
-
}
|
|
3839
|
-
}
|
|
3840
|
-
});
|
|
3841
|
-
// DataTables `dom` feature option
|
|
3842
|
-
dataTable.ext.feature.push({
|
|
3843
|
-
cFeature: 'Q',
|
|
3844
|
-
fnInit: _init
|
|
3845
|
-
});
|
|
3846
|
-
// DataTables 2 layout feature
|
|
3847
|
-
if (dataTable.ext.features) {
|
|
3848
|
-
dataTable.ext.features.register('searchBuilder', _init);
|
|
3849
3849
|
}
|
|
3850
|
-
})
|
|
3850
|
+
});
|
|
3851
|
+
// DataTables `dom` feature option
|
|
3852
|
+
DataTable.ext.feature.push({
|
|
3853
|
+
cFeature: 'Q',
|
|
3854
|
+
fnInit: _init
|
|
3855
|
+
});
|
|
3856
|
+
// DataTables 2 layout feature
|
|
3857
|
+
if (DataTable.ext.features) {
|
|
3858
|
+
DataTable.ext.features.register('searchBuilder', _init);
|
|
3859
|
+
}
|
|
3851
3860
|
|
|
3852
3861
|
}());
|
|
3862
|
+
|
|
3863
|
+
|
|
3864
|
+
return DataTable;
|
|
3865
|
+
}));
|