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