expressions.js
1.58 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
$(document).ready(function() {
// Setup - add a text input to each footer cell
$('#expressions tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="'+title+'" />' );
} );
// DataTable
var table = $('#expressions').DataTable({
"processing": true,
"serverSide": true,
"ajax": ajax_expressions,
"oLanguage": {
"sSearch": "Wyszukaj:",
"sZeroRecords": "Brak wyników do wyświetlenia",
"sInfo": "_TOTAL_ wpisów do pokazania (_START_ do _END_)",
"sInfoFiltered": "(odfiltrowane z _MAX_ wpisów)",
"oPaginate": {
"sPrevious": "Poprzednie",
"sNext": "Następne"
},
"sLengthMenu": 'Pokaż _MENU_ wpisów',
"sProcessing": 'Ładowanie...'
},
"columnDefs": [
{ "orderable": false, "targets": 1 },
{ "orderable": false, "targets": 2 }
]
});
table.on('processing.dt', function(e, settings, processing) {
$('#expressionInfo').empty();
});
$('#expressions tbody').on('click', 'tr', function() {
var data = table.row(this).data();
$('#expressionInfo').load(ajax_expression_info, 'id='+data[3]);
});
// Apply the search
table.columns().every( function () {
var that = this;
$('input', this.footer()).on('keyup change', function() {
if (that.search() !== this.value) {
that.search(this.value).draw();
}
} );
} );
} );