<script type="text/javascript">
function KohaTable(id_selector, dt_parameters, columns_settings, add_filters) {
- var id = 0;
+ var counter = 0;
var hidden_ids = [];
var included_ids = [];
+ var selector = '#' + id_selector;
+
$(columns_settings).each( function() {
var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( 'th' );
- var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : id;
+ var used_id = dt_parameters.bKohaColumnsUseNames ? named_id : counter;
if ( used_id == -1 ) return;
if ( this['is_hidden'] == "1" ) {
if ( this['cannot_be_toggled'] == "0" ) {
included_ids.push( used_id );
}
- id++;
+ counter++;
});
dt_parameters[ "buttons" ] = [
{
}
];
- var table = $('#' + id_selector + ' table');
+ var table = $(selector);
if ( add_filters ) {
// Duplicate the table header row for columnFilter
thead_row = table.find('thead tr');
link = $('<a>')
.attr('href', '#')
.attr('id', id_selector + '_activate_filters');
- $("." + id_selector + "_table_controls").prepend(link);
+ $("." + id_selector + "_table_controls").prepend(link);
deactivate_filters(id_selector);
}
var MSG_REMOVE_PATRON = _("Remove");
$(document).ready(function() {
var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) %];
- KohaTable("#histsearcht", {
+ KohaTable("histsearcht", {
"aoColumnDefs": [
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
$(document).ready(function() {
var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'lateorders', 'late_orders', 'json' ) %];
- late_orderst = KohaTable("#late_orders", {
+ late_orderst = KohaTable("late_orders", {
"aoColumnDefs": [
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
$(document).ready(function() {
columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %]
- var issuest = KohaTable("#currencies-table", {
+ var issuest = KohaTable("currencies-table", {
dom: 'B<"clearfix">t',
"columnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
[% items_table_block_iter = 0 %]
[% BLOCK items_table %]
[% items_table_block_iter = items_table_block_iter + 1 %]
- <div class="[% tab %]_table_controls">
+ <div class="[% tab %]_table_table_controls">
[% IF (StaffDetailItemSelection) %]
| <a href="#" class="SelectAll" data-tab="[% tab %]"><i class="fa fa-check"></i> Select all</a> |
<a href="#" class="ClearAll" data-tab="[% tab %]"><i class="fa fa-remove"></i> Clear all</a>
</span>
[% END %]
</div>
- <table class="items_table">
+ <table class="items_table" id="[% tab %]_table">
<thead>
<tr>
[% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %]
browser.show();
$(document).ready(function() {
- var ids = ['holdings', 'otherholdings'];
+ var ids = ['holdings_table', 'otherholdings_table'];
for (var i in ids) {
var id = ids[i];
// Skip the first column
columns_settings.unshift( { cannot_be_toggled: "1" } );
- var itemst = KohaTable("#itemst", {
+ var itemst = KohaTable("itemst", {
"aoColumnDefs": [
{ "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
],
<script type="text/javascript">
$(document).ready(function() {
var columns_settings = [% ColumnsSettings.GetColumns('circ', 'holds', 'holds-to-pull', 'json') %];
- var holdst = KohaTable("#holdst", {
+ var holdst = KohaTable("holdst", {
"aoColumnDefs": [
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
{ "sType": "title-string", "aTargets" : [ "title-string" ] },
[% END %]
var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
- var returns_table = KohaTable("#checkedintable", {
+ var returns_table = KohaTable("checkedintable", {
"bFilter":false,
"bPaginate":false,
"bInfo":false,
$('#holdst thead input').on('change keyup keydown', filterColumn);
var columns_settings = [% ColumnsSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') %];
- var holdst = KohaTable("#holdst", {
+ var holdst = KohaTable("holdst", {
"aaSorting": [[ 3, "asc" ]],
"aoColumns": [
{ "sType": "anti-the" },null,null,null,null,null,null,null,null,{ "sType": "title-string" },null
var txtActivefilter = _("Filter paid transactions");
var txtInactivefilter = _("Show all transactions");
var columns_settings = [% ColumnsSettings.GetColumns('members', 'fines', 'account-fines', 'json') %];
- var table_account_fines = KohaTable("#table_account_fines", {
+ var table_account_fines = KohaTable("table_account_fines", {
"sPaginationType": "four_button",
'aaSorting': [[0, 'desc']],
"sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Patrons [% IF ( searching ) %]› Search results[% END %]</title>
-[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
</head>
[%# Remove the first column if we do not display the checkbox %]
columns_settings.splice(0, 1);
[% END %]
- dtMemberResults = KohaTable("#memberresultst", {
+ dtMemberResults = KohaTable("memberresultst", {
'bServerSide': true,
'sAjaxSource': "/cgi-bin/koha/svc/members/search",
'fnServerData': function(sSource, aoData, fnCallback) {
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
+ <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script>
[% INCLUDE 'columns_settings.inc' %]
+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/table_filters.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
var columns_settings = [% ColumnsSettings.GetColumns( 'reports', 'lostitems', 'lostitems-table', 'json' ) %];
- var lostitems_table = KohaTable("#lostitems-table", {
+ var lostitems_table = KohaTable("lostitems-table", {
"dom": 'B<"clearfix">t',
"aaSorting": [],
"aoColumnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
],
+ 'bAutoWidth': false,
"bPaginate": false,
- }, columns_settings);
-
+ }, columns_settings, 'with_filters');
});
</script>
[% END %]
function activate_filters(id) {
- var table = $("#" + id + " table");
+ var table = $("#" + id );
if (table.length == 1) {
filters_row = table.find('thead tr.filters_row');
}
function deactivate_filters(id) {
- filters_row = $("#" + id + " table").find('thead tr.filters_row');
+ filters_row = $("#" + id ).find('thead tr.filters_row');
filters_row.find('input[type="text"]')
.val('') // Empty filter text boxes