-
Notifications
You must be signed in to change notification settings - Fork 0
/
table.js
43 lines (37 loc) · 1.25 KB
/
table.js
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
/*
function myFunction() {
// Declare variables
var input, filter, table, tr, td, i, txtValue;
input = document.getElementById("tsearch");
filter = input.value.toUpperCase();
table = document.getElementById("dt");
tr = table.getElementsByTagName("tr");
// Loop through all table rows, and hide those who don't match the search query
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[0];
if (td) {
txtValue = td.textContent || td.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
tr[i].style.display = "";
} else {
tr[i].style.display = "none";
}
}
}
}
$(document).ready(function () {
$('#dt').dataTable({
destroy: true,
"pageLength": 10,
"aaSorting": [],
"lengthMenu": [[10, 50, 100, -1], [10, 50, 100, "All"]],
"dom": 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "//Vendor/datatables/media/swf/copy_csv_xls_pdf.swf"
}
});
});
*/
$(document).ready(function() {
$('#dt').dataTable();
} );