Lines 467-521
$(document).ready(function() {
Link Here
|
467 |
} |
467 |
} |
468 |
var tab_data = spliceTabData($.extend(true, [], tab_data_copy), i); |
468 |
var tab_data = spliceTabData($.extend(true, [], tab_data_copy), i); |
469 |
|
469 |
|
470 |
// Initialise the datatable |
470 |
// Initialise the datatable |
471 |
table = KohaTable(illreq_tab_id, { |
471 |
table = KohaTable(illreq_tab_id, { |
472 |
'aoColumnDefs': [ |
472 |
'aoColumnDefs': [ |
473 |
{ // Last column shouldn't be sortable or searchable |
473 |
{ // Last column shouldn't be sortable or searchable |
474 |
'aTargets': [ 'actions' ], |
474 |
'aTargets': [ 'actions' ], |
475 |
'bSortable': false, |
475 |
'bSortable': false, |
476 |
'bSearchable': false |
476 |
'bSearchable': false |
477 |
}, |
477 |
}, |
478 |
{ // When sorting 'placed', we want to use the |
478 |
{ // When sorting 'placed', we want to use the |
479 |
// unformatted column |
479 |
// unformatted column |
480 |
'aTargets': [ 'placed_formatted'], |
480 |
'aTargets': [ 'placed_formatted'], |
481 |
'iDataSort': 14 |
481 |
'iDataSort': 14 |
482 |
}, |
482 |
}, |
483 |
{ // When sorting 'updated', we want to use the |
483 |
{ // When sorting 'updated', we want to use the |
484 |
// unformatted column |
484 |
// unformatted column |
485 |
'aTargets': [ 'updated_formatted'], |
485 |
'aTargets': [ 'updated_formatted'], |
486 |
'iDataSort': 16 |
486 |
'iDataSort': 16 |
487 |
}, |
487 |
}, |
488 |
{ // When sorting 'completed', we want to use the |
488 |
{ // When sorting 'completed', we want to use the |
489 |
// unformatted column |
489 |
// unformatted column |
490 |
'aTargets': [ 'completed_formatted'], |
490 |
'aTargets': [ 'completed_formatted'], |
491 |
'iDataSort': 19 |
491 |
'iDataSort': 19 |
492 |
} |
492 |
} |
493 |
], |
493 |
], |
494 |
'aaSorting': [[ 16, 'desc' ]], // Default sort, updated descending |
494 |
'aaSorting': [[ 16, 'desc' ]], // Default sort, updated descending |
495 |
'processing': true, // Display a message when manipulating |
495 |
'processing': true, // Display a message when manipulating |
496 |
'sPaginationType': "full_numbers", // Pagination display |
496 |
'sPaginationType': "full_numbers", // Pagination display |
497 |
'deferRender': true, // Improve performance on big datasets |
497 |
'deferRender': true, // Improve performance on big datasets |
498 |
'data': tab_data, |
498 |
'data': tab_data, |
499 |
"dom": '<"top pager"<"table_entries"ilp><"table_controls"B>>tr<"bottom pager"ip>', |
499 |
"dom": '<"top pager"<"table_entries"ilp><"table_controls"B>>tr<"bottom pager"ip>', |
500 |
'columns': colData, |
500 |
'columns': colData, |
501 |
'originalData': data, // Enable render functions to access |
501 |
'originalData': data, // Enable render functions to access |
502 |
// our original data |
502 |
// our original data |
503 |
'initComplete': function() { |
503 |
'initComplete': function() { |
504 |
|
504 |
|
505 |
// Prepare any filter elements that need it |
505 |
// Prepare any filter elements that need it |
506 |
for (var el in filterable) { |
506 |
for (var el in filterable) { |
507 |
if (filterable.hasOwnProperty(el)) { |
507 |
if (filterable.hasOwnProperty(el)) { |
508 |
if (filterable[el].hasOwnProperty('prep')) { |
508 |
if (filterable[el].hasOwnProperty('prep')) { |
509 |
filterable[el].prep(dataCopy, data); |
509 |
filterable[el].prep(dataCopy, data); |
510 |
} |
510 |
} |
511 |
if (filterable[el].hasOwnProperty('listener')) { |
511 |
if (filterable[el].hasOwnProperty('listener')) { |
512 |
filterable[el].listener(); |
512 |
filterable[el].listener(); |
|
|
513 |
} |
513 |
} |
514 |
} |
514 |
} |
515 |
} |
515 |
} |
|
|
516 |
|
516 |
|
517 |
} |
517 |
} |
518 |
}, columns_settings); |
518 |
}, columns_settings); |
519 |
} |
519 |
} |
520 |
|
520 |
|
521 |
// Custom date range filtering |
521 |
// Custom date range filtering |
522 |
- |
|
|