Bug 22811

Summary: Add button to clear DataTables filtering
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: katrin.fischer, martin.renvoize, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00
Bug Depends on:    
Bug Blocks: 22888    
Attachments: Screen grab showing clear button interaction
Bug 22811: Add button to clear DataTables filtering
Bug 22811: Add button to clear DataTables filtering
Bug 22811: Add button to clear DataTables filtering

Description Owen Leonard 2019-04-30 15:07:20 UTC
Created attachment 89136 [details]
Screen grab showing clear button interaction

I propose that we add a "Clear filter" button to the global DataTables configuration which will be displayed if the table has a search form.
Comment 1 Owen Leonard 2019-04-30 15:38:39 UTC
Created attachment 89138 [details] [review]
Bug 22811: Add button to clear DataTables filtering

This patch adds a "clear filter" button to the global
DataTables configuration. The button will appear if:

 - There is no custom DOM configuration applied to the DataTable
   instance.
 - The DataTable has the search form enabled.

The new button should be disabled by default. Entering a search term in
the form should enable it.

To test, apply the patch and clear your browser cache if necessary. View
various pages with various DataTables configurations and confirm that
everything looks correct and the new "Clear filter" button doesn't
appear when there is no DataTable search field. For example:

 - Administration -> Libraries
 - Administration -> Currencies
 - Reports -> Saved reports
 - Circulation -> Check out
 - Tools -> News
Comment 2 Liz Rea 2019-04-30 17:01:21 UTC
Created attachment 89143 [details] [review]
Bug 22811: Add button to clear DataTables filtering

This patch adds a "clear filter" button to the global
DataTables configuration. The button will appear if:

 - There is no custom DOM configuration applied to the DataTable
   instance.
 - The DataTable has the search form enabled.

The new button should be disabled by default. Entering a search term in
the form should enable it.

To test, apply the patch and clear your browser cache if necessary. View
various pages with various DataTables configurations and confirm that
everything looks correct and the new "Clear filter" button doesn't
appear when there is no DataTable search field. For example:

 - Administration -> Libraries
 - Administration -> Currencies
 - Reports -> Saved reports
 - Circulation -> Check out
 - Tools -> News

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 3 Katrin Fischer 2019-05-01 09:21:01 UTC
Only thing maybe... I feel the buttons are a little big and the problem and I am sorry German translations will make it worse (why are our words so loooong?)
Comment 4 Katrin Fischer 2019-05-01 09:21:57 UTC
Created attachment 89160 [details] [review]
Bug 22811: Add button to clear DataTables filtering

This patch adds a "clear filter" button to the global
DataTables configuration. The button will appear if:

 - There is no custom DOM configuration applied to the DataTable
   instance.
 - The DataTable has the search form enabled.

The new button should be disabled by default. Entering a search term in
the form should enable it.

To test, apply the patch and clear your browser cache if necessary. View
various pages with various DataTables configurations and confirm that
everything looks correct and the new "Clear filter" button doesn't
appear when there is no DataTable search field. For example:

 - Administration -> Libraries
 - Administration -> Currencies
 - Reports -> Saved reports
 - Circulation -> Check out
 - Tools -> News

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Nick Clemens 2019-05-09 19:33:24 UTC
Awesome work all!

Pushed to master for 19.05
Comment 6 Martin Renvoize 2019-05-16 14:37:21 UTC
Enhancement will not be backported to 18.11.x series.
Comment 7 Martin Renvoize 2019-05-17 13:16:55 UTC
Enhancement will not be backported to 18.11.x series.