Bug 22803

Summary: Set dataTable width issue
Product: Koha Reporter: Arthur Suzuki <arthur.suzuki>
Component: OPACAssignee: Arthur Suzuki <arthur.suzuki>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: m.de.rooy, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00
Bug Depends on: 11976    
Bug Blocks:    
Attachments: Bug 22803: Fix dataTable width
Shrinked subscription table
Bug 22803: (alternate) Set dataTable width issue
Bug 22803: (alternate) Set dataTable width issue
Bug 22803: (alternate) Set dataTable width issue

Description Arthur Suzuki 2019-04-29 14:12:58 UTC
When some columns are hidden in the Serials Subscription columns settings (see bug 11976) the table shrinks due to a "style=width:0%" which is automatically added by dataTable.

Solved by adding a rule in css/datatables.css
Comment 1 Arthur Suzuki 2019-04-29 14:20:27 UTC
Created attachment 89011 [details] [review]
Bug 22803: Fix dataTable width

Test plan :
1 - Go to Administration / Configure columns
2 - check Opac/serial_notes "is hidden by defaut"
3 - search a serials on the opac and in the opac-details page, subscriptions tab, find out that the table is shrinked on the left
4 - Apply patch
5 - Find out subscription table fills the tab correctly
Comment 2 Owen Leonard 2019-04-29 14:44:23 UTC
Could you add a screeshot showing the problem? I don't think I'm seeing the problem.

I'm hoping there might be another way to fix it. Adding an "!important" rule is not ideal.
Comment 3 Arthur Suzuki 2019-04-29 15:14:38 UTC
Created attachment 89016 [details]
Shrinked subscription table
Comment 4 Owen Leonard 2019-04-29 15:54:04 UTC
Created attachment 89035 [details] [review]
Bug 22803: (alternate) Set dataTable width issue

This patch sets the "autowidth" option to "false" for the OPAC
subscriptions DataTable on opac-detail.pl. This gives the table a fluid
width rather than having the width be "hard-coded" by DataTables upon
first page render.

To test, apply the patch and view the detail page for a bibliographic
record with a subscription. Under the "Subscriptions" tab, the table of
latest issues should fill the width of the tab container.

Resize the browser window and confirm that the table width adjusts
accordingly.
Comment 5 Owen Leonard 2019-04-29 15:54:58 UTC
I'm proposing an alternate solution. I think this is the correct way to deal with it within the options provided by DataTables.

The "autowidth" option should probably be set to "false" globally.
Comment 6 Liz Rea 2019-05-01 00:26:35 UTC
Created attachment 89157 [details] [review]
Bug 22803: (alternate) Set dataTable width issue

This patch sets the "autowidth" option to "false" for the OPAC
subscriptions DataTable on opac-detail.pl. This gives the table a fluid
width rather than having the width be "hard-coded" by DataTables upon
first page render.

To test, apply the patch and view the detail page for a bibliographic
record with a subscription. Under the "Subscriptions" tab, the table of
latest issues should fill the width of the tab container.

Resize the browser window and confirm that the table width adjusts
accordingly.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 7 Marcel de Rooy 2019-05-03 09:27:08 UTC
Created attachment 89301 [details] [review]
Bug 22803: (alternate) Set dataTable width issue

This patch sets the "autowidth" option to "false" for the OPAC
subscriptions DataTable on opac-detail.pl. This gives the table a fluid
width rather than having the width be "hard-coded" by DataTables upon
first page render.

To test, apply the patch and view the detail page for a bibliographic
record with a subscription. Under the "Subscriptions" tab, the table of
latest issues should fill the width of the tab container.

Resize the browser window and confirm that the table width adjusts
accordingly.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 8 Nick Clemens 2019-05-10 14:53:25 UTC
Awesome work all!

Pushed to master for 19.05
Comment 9 Martin Renvoize 2019-05-17 13:46:08 UTC
Enhancement will not be backported to 18.11.x series.