|
37 | 37 | success: function(result) { |
38 | 38 | count += 1; |
39 | 39 | $('#remaining').text(top_role_dns.length - count) |
40 | | - if (i1 + 1 == role_dns_count) { |
41 | | - $('#loading').slideUp(); |
42 | | - } |
43 | 40 | $.each(result['roles'], function(i2, role){ |
44 | 41 |
|
45 | 42 | var users = $('<tbody>'); |
|
144 | 141 | }); |
145 | 142 |
|
146 | 143 | $('#' + div_id) |
147 | | - .addClass('nrc_role') |
| 144 | + .addClass('nrc_role') |
148 | 145 | .append( |
149 | 146 | $('<h3>') |
150 | 147 | .attr('id', role['role_id']) |
|
160 | 157 | ) |
161 | 158 | ) |
162 | 159 | ); |
163 | | - if (role['users'].length > 0){ |
164 | | - $('#' + div_id).append( |
165 | | - $('<table>').addClass('account-datatable') |
166 | | - .append($('<thead>') |
167 | | - .append($('<tr>') |
168 | | - .append($('<td>').text('PCP')) |
169 | | - .append($('<td>').text('Name')) |
170 | | - .append(thead_a) |
171 | | - ) |
172 | | - ) |
173 | | - .append(users) |
| 160 | + if (role['users'].length > 0){ |
| 161 | + $('#' + div_id).append( |
| 162 | + $('<table>').addClass('account-datatable dataTable') |
| 163 | + .append($('<thead>') |
| 164 | + .append($('<tr>') |
| 165 | + .append($('<td>').text('PCP')) |
| 166 | + .append($('<td>').text('Name')) |
| 167 | + .append(thead_a) |
174 | 168 | ) |
175 | | - .append($('<div>').addClass('clear').html(' ')) |
176 | | - } else { |
177 | | - $('#' + div_id).append($('<p>').text('No member')) |
178 | | - }; |
179 | | - $('#' + div_id).append( |
180 | | - $('<div>').addClass('left-position').append( |
181 | | - $('<a>') |
182 | | - .addClass('account-link button') |
183 | | - .attr({ |
184 | | - href: '#main-container', |
185 | | - title: 'Click to go back to top' |
186 | | - }) |
187 | | - .html('<img src="/++resource++eea.ldapadmin-www/up.png" class="middle-image image12" alt="" title="Back to top" /> Back to top') |
188 | 169 | ) |
189 | | - ).append($('<div>').addClass('clear').html(' ')) |
| 170 | + .append(users) |
| 171 | + ) |
| 172 | + .append($('<div>').addClass('clear').html(' ')) |
| 173 | + } else { |
| 174 | + $('#' + div_id).append($('<p>').text('No member')) |
| 175 | + }; |
| 176 | + $('#' + div_id).append( |
| 177 | + $('<div>').addClass('left-position').append( |
| 178 | + $('<a>') |
| 179 | + .addClass('account-link button') |
| 180 | + .attr({ |
| 181 | + href: '#main-container', |
| 182 | + title: 'Click to go back to top' |
| 183 | + }) |
| 184 | + .html('<img src="/++resource++eea.ldapadmin-www/up.png" class="middle-image image12" alt="" title="Back to top" /> Back to top'))) |
| 185 | + .append($('<div>').addClass('clear').html(' ')) |
| 186 | + if (i1 + 1 == role_dns_count) { |
| 187 | + $('#loading').slideUp(); |
| 188 | + requirejs(["datatables.net"], function() { |
| 189 | + window.data_table = $('.dataTable').dataTable({ |
| 190 | + "aaSorting": [[1, "asc"]], |
| 191 | + "sPaginationType": "full_numbers", |
| 192 | + "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], |
| 193 | + "oLanguage": { |
| 194 | + "sSearch": "Apply filter _INPUT_ to table" |
| 195 | + } |
| 196 | + }); |
| 197 | + }); |
| 198 | + } |
190 | 199 | }); |
191 | 200 | } |
192 | 201 | }); |
|
0 commit comments