Bugzilla – Attachment 14917 Details for
Bug 9462
Use DataTables on patron detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9462 [Revised] Use DataTables on patron detail page
Bug-9462-Revised-Use-DataTables-on-patron-detail-p.patch (text/plain), 4.22 KB, created by
Owen Leonard
on 2013-01-29 15:34:28 UTC
(
hide
)
Description:
Bug 9462 [Revised] Use DataTables on patron detail page
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-01-29 15:34:28 UTC
Size:
4.22 KB
patch
obsolete
>From ff163686d53a7f1d67f3816ea2bd04747b90dd90 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 23 Jan 2013 12:16:39 -0500 >Subject: [PATCH] Bug 9462 [Revised] Use DataTables on patron detail page >Content-Type: text/plain; charset="utf-8" > >Replace the tablesorter plugin with the DataTables plugin on the >patron detail page. > >To test, open a patron detail page for a patron who has checkouts, >holds, and relatives' checkouts. Confirm that table sorting works >correctly for each of those three tables. > >Revision adds some JavaScript designed to handle table-sizing for tables >which are hidden initally in tabs. DataTables has an approved method for >handling these cases: >http://www.datatables.net/examples/api/tabs_and_scrolling.html > >This should prevent the table of existing holds from looking squeezed. >--- > .../prog/en/modules/members/moremember.tt | 59 ++++++++++++-------- > 1 file changed, 36 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index bbb5cab..ddb6f36 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -9,33 +9,46 @@ > </title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] >-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script> >+<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" /> >+<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script> >+[% INCLUDE 'datatables-strings.inc' %] >+<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script> > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script> >-<script type="text/JavaScript" language="JavaScript"> >+<script type="text/JavaScript"> > //<![CDATA[ >-$.tablesorter.addParser({ >- id: 'articles', >- is: function(s) {return false; }, >- format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); }, >- type: 'text' >-}); > $(document).ready(function() { >- $('#finesholdsissues').tabs(); >- $.tablesorter.defaults.widgets = ['zebra']; >- $("#issuest").tablesorter({[% IF ( dateformat_metric ) %] >- dateFormat: 'uk',[% END %] >- headers: { 1: { sorter: 'articles'},8:{sorter:false},9:{sorter:false }} >- }); >- $("#relissuest").tablesorter({[% IF ( dateformat_metric ) %] >- dateFormat: 'uk',[% END %] >- headers: { 1: { sorter: 'articles'},8:{sorter:false},9:{sorter:false }} >- }); >- $("#holdst").tablesorter({[% IF ( dateformat_metric ) %] >- dateFormat: 'uk',[% END %] >- sortList: [[0,0]], >- headers: { 1: { sorter: 'articles' },5: { sorter: false }} >- }); >+ $('#finesholdsissues').tabs({ >+ // Correct table sizing for tables hidden in tabs >+ // http://www.datatables.net/examples/api/tabs_and_scrolling.html >+ "show": function(event, ui) { >+ var oTable = $('div.dataTables_wrapper>table', ui.panel).dataTable(); >+ if ( oTable.length > 0 ) { >+ oTable.fnAdjustColumnSizing(); >+ } >+ } >+ } ); >+ $("#issuest").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sDom": 't', >+ "aoColumnDefs": [ >+ { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false } >+ ], >+ "bPaginate": false >+ })); >+ $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sDom": 't', >+ "aoColumnDefs": [ >+ { "aTargets": [ 0,8 ], "bSortable": false, "bSearchable": false } >+ ], >+ "bPaginate": false >+ })); >+ $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sDom": 't', >+ "aoColumnDefs": [ >+ { "aTargets": [ -1,-2 ], "bSortable": false, "bSearchable": false } >+ ], >+ "bPaginate": false >+ })); > [% IF ( picture ) %] > // new YAHOO.widget.Button("delpicture"); // FIXME: formatting mismatch between YUI and normal button > $('#delpicture').click(function(){ >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9462
:
14795
|
14843
|
14917
|
15180
|
15223