|
Lines 475-481
$(document).ready(function() {
Link Here
|
| 475 |
fnCallback(json) |
475 |
fnCallback(json) |
| 476 |
} ); |
476 |
} ); |
| 477 |
}, |
477 |
}, |
| 478 |
"fnInitComplete": function(oSettings) { |
478 |
"fnInitComplete": function(oSettings, json) { |
| 479 |
// Disable rowGrouping plugin after first use |
479 |
// Disable rowGrouping plugin after first use |
| 480 |
// so any sorting on the table doesn't use it |
480 |
// so any sorting on the table doesn't use it |
| 481 |
var oSettings = issuesTable.fnSettings(); |
481 |
var oSettings = issuesTable.fnSettings(); |
|
Lines 488-493
$(document).ready(function() {
Link Here
|
| 488 |
} |
488 |
} |
| 489 |
|
489 |
|
| 490 |
oSettings.aaSortingFixed = null; |
490 |
oSettings.aaSortingFixed = null; |
|
|
491 |
|
| 492 |
// Build a summary of checkouts grouped by itemtype |
| 493 |
var checkoutsByItype = json.aaData.reduce(function (obj, row) { |
| 494 |
obj[row.itemtype_description] = (obj[row.itemtype_description] || 0) + 1; |
| 495 |
return obj; |
| 496 |
}, {}); |
| 497 |
var ul = $('<ul>'); |
| 498 |
Object.keys(checkoutsByItype).sort().forEach(function (itype) { |
| 499 |
var li = $('<li>') |
| 500 |
.append($('<strong>').html(itype || _("No itemtype"))) |
| 501 |
.append(': ' + checkoutsByItype[itype]); |
| 502 |
ul.append(li); |
| 503 |
}) |
| 504 |
$('<details>') |
| 505 |
.append($('<summary>').html(_("Number of checkouts by item type"))) |
| 506 |
.append(ul) |
| 507 |
.insertBefore(oSettings.nTableWrapper) |
| 491 |
}, |
508 |
}, |
| 492 |
}, columns_settings).rowGrouping( |
509 |
}, columns_settings).rowGrouping( |
| 493 |
{ |
510 |
{ |
| 494 |
- |
|
|