Description
Julian Maurice
2012-11-08 15:37:23 UTC
Created attachment 13310 [details] [review] Bug 9034: Add sorting and filtering on items table (catalogue/detail.pl) This patch introduces a new javascript plugin for dataTables (columnFilter). After applying this patch the detail page has a horizontal scroll bar if my browser windows is below 1800px. Is there a way to accomplish the goal of this patch without compromising the compactness and flexibility of the current layout? Created attachment 13338 [details] [review] Bug 9034: Add CSS rule to reduce width of items table I tested it with a browser window width reduced to 1280px Created attachment 13345 [details] [review] [SIGNED-OFF] Bug 9034: Add sorting and filtering on items table (catalogue/detail.pl) This patch introduces a new javascript plugin for dataTables (columnFilter). Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 13346 [details] [review] [SIGNED-OFF] Bug 9034: Add CSS rule to reduce width of items table Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Tested, looks good. I don't know if everyone is going to want the column filters. Maybe there should be a threshold number of items a bib needs for it to kick in? Created attachment 13368 [details] [review] Bug 9034 [Follow-up] Add sorting and filtering on items table (catalogue/detail.pl) This follow-up to the original patch offers an alternative method to handle the width of the table and form fields: - Reduce the font size of the filter input fields - Make the filter inputs' width 100% instead of fixed - Add "'bAutoWidth': false" to the datatables initialization to prevent the table width from being set to the browser window width on load. This allows the browser to be re-sized and have the table re-flow with it. I offer an alternative to the "CSS rule" patch for consideration. I agree with Kyle in thinking that probably not everyone is going to want column filters. My first thought was also to define a threshold to control it. Was this feature requested based on a collection with a large number of items per bib? Perhaps if we understood the motivation for wanting this feature we could better understand how to make it work for everyone. > - Make the filter inputs' width 100% instead of fixed I always had problems with this (input overflow the cell), but if it works i prefer this solution ;-) The initial need was only to filter on "serial info" column for biblios linked to a subscription (so a large number of items), and then go to batch modification/deletion. I separated this into two bugs: this one and bug 9044 which allow to select items and go to batch modification/deletion. Created attachment 14491 [details] [review] [SIGNED-OFF] Bug 9034: Add sorting and filtering on items table (catalogue/detail.pl) Rebased on master Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 14492 [details] [review] [SIGNED-OFF] Bug 9034: Add CSS rule to reduce width of items table Rebased on master Created attachment 14493 [details] [review] [SIGNED-OFF] Bug 9034 [Follow-up] Add sorting and filtering on items table (catalogue/detail.pl) Rebased on master and signed off Created attachment 14494 [details] [review] Bug 9034: Filters are disabled by default A small link above the table allow to enable this feature. The last patch disable the filtering feature and provide a link to enable it Created attachment 14743 [details] [review] [SIGNED-OFF] Bug 9034: Filters are disabled by default A small link above the table allow to enable this feature. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> QA comment: To test it, go on a catalogue detail page and play with the items list. This patch adds datatable on the items table and an elegant filter method. Code is clean and the 2 datatable features (sort + filter) work great. Marked as Passed QA. Created attachment 15137 [details] [review] Bug 9034: Add sorting and filtering on items table (catalogue/detail.pl) This patch introduces a new javascript plugin for dataTables (columnFilter). Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Created attachment 15138 [details] [review] Bug 9034: Add CSS rule to reduce width of items table Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Created attachment 15139 [details] [review] Bug 9034 [Follow-up] Add sorting and filtering on items table (catalogue/detail.pl) This follow-up to the original patch offers an alternative method to handle the width of the table and form fields: - Reduce the font size of the filter input fields - Make the filter inputs' width 100% instead of fixed - Add "'bAutoWidth': false" to the datatables initialization to prevent the table width from being set to the browser window width on load. This allows the browser to be re-sized and have the table re-flow with it. Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Created attachment 15140 [details] [review] Bug 9034: Filters are disabled by default A small link above the table allow to enable this feature. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Amended patch: Replace single quote strings with double quote strings This patch has been pushed to master. |