-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScript21b.js
More file actions
31 lines (28 loc) · 1.1 KB
/
Script21b.js
File metadata and controls
31 lines (28 loc) · 1.1 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
// JavaScript source code
dataTableEvents = $('#events')
.DataTable({
initComplete: function() {
this.api()
.columns()
.every(function() {
var column = this;
var select = $("<select><option value=''></option></select>")
.appendTo($(column.footer()).empty())
.on('change',
function() {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search(val ? '^' + val + '$' : '', true, false)
.draw();
});
column.data()
.unique()
.sort()
.each(function(d, j) {
select.append("<option value='" + d + "'>" + d + "</option>")
});
});
},
});