|
Lines 366-393
Link Here
|
| 366 |
[% END %] |
366 |
[% END %] |
| 367 |
|
367 |
|
| 368 |
// Build the aLengthMenu |
368 |
// Build the aLengthMenu |
| 369 |
var aLengthMenu = [ |
369 |
var aLengthMenu = [10, 20, 50, 100, -1]; |
| 370 |
[% PatronsPerPage | html %], 10, 20, 50, 100, -1 |
370 |
var aLengthMenuLabel = [10, 20, 50, 100, _("All")]; |
| 371 |
]; |
371 |
var patronsPerPage = [% PatronsPerPage | html %]; |
| 372 |
jQuery.unique(aLengthMenu); |
372 |
for ( var i = 0; i < aLengthMenu.length; i++ ) { |
| 373 |
aLengthMenu.sort(function( a, b ){ |
373 |
if ( aLengthMenu[i] == patronsPerPage ) { |
| 374 |
// Put "All" at the end |
374 |
break; |
| 375 |
if ( a == -1 ) { |
|
|
| 376 |
return 1; |
| 377 |
} else if ( b == -1 ) { |
| 378 |
return -1; |
| 379 |
} |
375 |
} |
| 380 |
return parseInt(a) < parseInt(b) ? -1 : 1;} |
376 |
if ( aLengthMenu[i] > patronsPerPage || aLengthMenu[i] == -1 ) { |
| 381 |
); |
377 |
aLengthMenu.splice(i, 0, patronsPerPage); |
| 382 |
var aLengthMenuLabel = []; |
378 |
aLengthMenuLabel.splice(i, 0, patronsPerPage); |
| 383 |
$(aLengthMenu).each(function(){ |
379 |
break; |
| 384 |
if ( this == -1 ) { |
|
|
| 385 |
// Label for -1 is "All" |
| 386 |
aLengthMenuLabel.push(_("All")); |
| 387 |
} else { |
| 388 |
aLengthMenuLabel.push(this); |
| 389 |
} |
380 |
} |
| 390 |
}); |
381 |
} |
| 391 |
|
382 |
|
| 392 |
// Apply DataTables on the results table |
383 |
// Apply DataTables on the results table |
| 393 |
var columns_settings = [% TablesSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) | $raw %]; |
384 |
var columns_settings = [% TablesSettings.GetColumns( 'members', 'member', 'memberresultst', 'json' ) | $raw %]; |
|
Lines 486-491
Link Here
|
| 486 |
"aLengthMenu": [aLengthMenu, aLengthMenuLabel], |
477 |
"aLengthMenu": [aLengthMenu, aLengthMenuLabel], |
| 487 |
'sPaginationType': 'full_numbers', |
478 |
'sPaginationType': 'full_numbers', |
| 488 |
"iDisplayLength": [% PatronsPerPage | html %], |
479 |
"iDisplayLength": [% PatronsPerPage | html %], |
|
|
480 |
"pageLength": [% PatronsPerPage | html %], |
| 489 |
"bProcessing": true, |
481 |
"bProcessing": true, |
| 490 |
"initComplete": function(settings, json) { |
482 |
"initComplete": function(settings, json) { |
| 491 |
Sticky = $("#searchheader"); |
483 |
Sticky = $("#searchheader"); |
| 492 |
- |
|
|