No Code Attached Yet bug
avatar rogercreagh
rogercreagh
29 May 2024

Steps to reproduce the issue

In an admin list view use the table.columns script to enable user to select columns to display and include either <tfoot> or colgroup elements in the table

Expected result

table.columns should work as it does for tables that don't have tfoot or colgroup elements

Actual result

the layout breaks with empty space at the right for the hidden columns and if <colgroup> is in play the classes and styles screwed up

System information (as much as possible)

Joomla 5.1 (and presumably 4)

Additional comments

This is slightly tricky to fix - I made a start but got lost and ran out of time so simply abandoned using table.columns.js in my J5 components - which is a shame since the core components are using it.

A simple unsatisfactory workaround would be to amend the script to simply do nothing if either <tfoot> or <colgroup> are present in the table.

A <colspan> anywhere in the table will also break it, but this perhaps could be more reasonably simply excluded as if you think about it it will be impossible to fix.

avatar rogercreagh rogercreagh - open - 29 May 2024
avatar joomla-cms-bot joomla-cms-bot - change - 29 May 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 May 2024
avatar rogercreagh
rogercreagh - comment - 29 May 2024

I have submitted a PR for a (temporary) documentation change until this can be fixed.

avatar Fedik
Fedik - comment - 29 May 2024

I set it as a bug, hovewer it is complex thing. And I think there a same issue with colspan.

In the end it probably will be won't fix.

avatar Fedik Fedik - change - 29 May 2024
Labels Added: bug
avatar Fedik Fedik - labeled - 29 May 2024
avatar rogercreagh
rogercreagh - comment - 29 May 2024

I suggest that if colspan is present in the table then table-columns should exit with and optional error/log message on being loaded. A simple test at the top of the createControls().

tfoot and colgroup are not impossible from my quick look at the code - in fact looking again today I can't remember exactly why I gave up on it. It is still on my todo list, albeit with a flag of drekley (which is a Cornish dialect word with a meaning like the Spanish manana but without the dreadful sense of urgency of manana)

avatar rogercreagh
rogercreagh - comment - 24 Jul 2024

closing this as issue as #43266 is the same and will be moved to a feature request discussion.

avatar HLeithner HLeithner - change - 25 Jul 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-07-25 06:01:10
Closed_By HLeithner
avatar HLeithner HLeithner - close - 25 Jul 2024

Add a Comment

Login with GitHub to post a comment