Show More
@@ -38,9 +38,10 b'' | |||
|
38 | 38 | <script type="text/javascript"> |
|
39 | 39 | |
|
40 | 40 | $(document).ready(function() { |
|
41 | var $userListTable = $('#user_list_table'); | |
|
41 | 42 | |
|
42 | 43 | var getDatatableCount = function(){ |
|
43 |
var table = $ |
|
|
44 | var table = $userListTable.dataTable(); | |
|
44 | 45 | var page = table.api().page.info(); |
|
45 | 46 | var active = page.recordsDisplay; |
|
46 | 47 | var total = page.recordsTotal; |
@@ -50,7 +51,7 b'' | |||
|
50 | 51 | }; |
|
51 | 52 | |
|
52 | 53 | // user list |
|
53 |
$ |
|
|
54 | $userListTable.DataTable({ | |
|
54 | 55 | processing: true, |
|
55 | 56 | serverSide: true, |
|
56 | 57 | ajax: "${h.route_path('users_data')}", |
@@ -76,7 +77,7 b'' | |||
|
76 | 77 | { data: {"_": "extern_type", |
|
77 | 78 | "sort": "extern_type"}, title: "${_('Auth type')}", className: "td-type" }, |
|
78 | 79 | { data: {"_": "action", |
|
79 | "sort": "action"}, title: "${_('Action')}", className: "td-action" } | |
|
80 | "sort": "action"}, title: "${_('Action')}", className: "td-action", orderable: false } | |
|
80 | 81 | ], |
|
81 | 82 | language: { |
|
82 | 83 | paginate: DEFAULT_GRID_PAGINATION, |
@@ -91,23 +92,23 b'' | |||
|
91 | 92 | } |
|
92 | 93 | }); |
|
93 | 94 | |
|
94 |
$ |
|
|
95 |
$ |
|
|
95 | $userListTable.on('xhr.dt', function(e, settings, json, xhr){ | |
|
96 | $userListTable.css('opacity', 1); | |
|
96 | 97 | }); |
|
97 | 98 | |
|
98 |
$ |
|
|
99 |
$ |
|
|
99 | $userListTable.on('preXhr.dt', function(e, settings, data){ | |
|
100 | $userListTable.css('opacity', 0.3); | |
|
100 | 101 | }); |
|
101 | 102 | |
|
102 | 103 | // refresh counters on draw |
|
103 |
$ |
|
|
104 | $userListTable.on('draw.dt', function(){ | |
|
104 | 105 | getDatatableCount(); |
|
105 | 106 | }); |
|
106 | 107 | |
|
107 | 108 | // filter |
|
108 | 109 | $('#q_filter').on('keyup', |
|
109 | 110 | $.debounce(250, function() { |
|
110 |
$ |
|
|
111 | $userListTable.DataTable().search( | |
|
111 | 112 | $('#q_filter').val() |
|
112 | 113 | ).draw(); |
|
113 | 114 | }) |
General Comments 0
You need to be logged in to leave comments.
Login now