Bug 22803 - Set dataTable width issue
Summary: Set dataTable width issue
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Arthur Suzuki
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 11976
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-29 14:12 UTC by Arthur Suzuki
Modified: 2019-05-17 13:46 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:
19.05.00


Attachments
Bug 22803: Fix dataTable width (998 bytes, patch)
2019-04-29 14:20 UTC, Arthur Suzuki
Details | Diff | Splinter Review
Shrinked subscription table (55.98 KB, image/png)
2019-04-29 15:14 UTC, Arthur Suzuki
Details
Bug 22803: (alternate) Set dataTable width issue (1.34 KB, patch)
2019-04-29 15:54 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 22803: (alternate) Set dataTable width issue (1.39 KB, patch)
2019-05-01 00:26 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 22803: (alternate) Set dataTable width issue (1.43 KB, patch)
2019-05-03 09:27 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.