Lines 176-181
$(document).ready(function() {
Link Here
|
176 |
}; |
176 |
}; |
177 |
//END Expand |
177 |
//END Expand |
178 |
|
178 |
|
|
|
179 |
var spliceTabData = function(tab_data, tab_i) { |
180 |
for (var j=0; tab_i>=0 && j<tab_data.length; j++) { |
181 |
if (!illreq_tabs[tab_i].status.includes(tab_data[j].status)) { |
182 |
tab_data.splice(j, 1); |
183 |
j--; |
184 |
} |
185 |
} |
186 |
return tab_data; |
187 |
}; |
188 |
|
179 |
// Strip the expand prefix if it exists, we do this for display |
189 |
// Strip the expand prefix if it exists, we do this for display |
180 |
var stripPrefix = function(value) { |
190 |
var stripPrefix = function(value) { |
181 |
expand.forEach(function(thisExpand) { |
191 |
expand.forEach(function(thisExpand) { |
Lines 446-453
$(document).ready(function() {
Link Here
|
446 |
colData.push(colObj); |
456 |
colData.push(colObj); |
447 |
}); |
457 |
}); |
448 |
|
458 |
|
|
|
459 |
|
460 |
var tab_data_copy = $.extend(true, [], dataCopy); |
461 |
for (var i=-1; i<illreq_tabs.length; i++) { // i=-1 is tab "All" |
462 |
var illreq_tab_id; |
463 |
if (i===-1) { |
464 |
illreq_tab_id = "ill-requests"; |
465 |
} else { |
466 |
illreq_tab_id = "ill-requests-illreq_tab-"+i; |
467 |
} |
468 |
var tab_data = spliceTabData($.extend(true, [], tab_data_copy), i); |
469 |
|
449 |
// Initialise the datatable |
470 |
// Initialise the datatable |
450 |
table = KohaTable("ill-requests", { |
471 |
table = KohaTable(illreq_tab_id, { |
451 |
'aoColumnDefs': [ |
472 |
'aoColumnDefs': [ |
452 |
{ // Last column shouldn't be sortable or searchable |
473 |
{ // Last column shouldn't be sortable or searchable |
453 |
'aTargets': [ 'actions' ], |
474 |
'aTargets': [ 'actions' ], |
Lines 474-480
$(document).ready(function() {
Link Here
|
474 |
'processing': true, // Display a message when manipulating |
495 |
'processing': true, // Display a message when manipulating |
475 |
'sPaginationType': "full_numbers", // Pagination display |
496 |
'sPaginationType': "full_numbers", // Pagination display |
476 |
'deferRender': true, // Improve performance on big datasets |
497 |
'deferRender': true, // Improve performance on big datasets |
477 |
'data': dataCopy, |
498 |
'data': tab_data, |
478 |
"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>', |
479 |
'columns': colData, |
500 |
'columns': colData, |
480 |
'originalData': data, // Enable render functions to access |
501 |
'originalData': data, // Enable render functions to access |
Lines 495-500
$(document).ready(function() {
Link Here
|
495 |
|
516 |
|
496 |
} |
517 |
} |
497 |
}, columns_settings); |
518 |
}, columns_settings); |
|
|
519 |
} |
498 |
|
520 |
|
499 |
// Custom date range filtering |
521 |
// Custom date range filtering |
500 |
$.fn.dataTable.ext.search.push(function(settings, data, dataIndex) { |
522 |
$.fn.dataTable.ext.search.push(function(settings, data, dataIndex) { |