FEATURE REQUEST table.columns.js does not hide column in footer #43838
Replies: 11 comments
-
when the script was written it only addressed the tables used in the core and to the best of my knowledge none of those have tfooter or colspan. As the script is something that a developer has to include (its not automatic) probably no one saw this as a problem. As you have a fix for the tfooter part then please submit a pull request with those changes. |
Beta Was this translation helpful? Give feedback.
-
Thank you Brian. I don't actually have a working fix yet, so far I simply looked in the source to see what was going wrong - it looks like it should be straightforward - just repeat everything done for the header with the footer if it exists and has the same column count - there will, however, be a nasty case where the footer uses colspans (as I have seen done in some extensions and example code) which will have to do something different which might be quite tricky. Personally I rarely (never) use colspans - generally I use the footer to repeat the header rows if the number of rows might be bigger than will fit on the screen, so there is always the same count of visible columns. (yes I know I could simply make the header row sticky which would be a better solution in this case) So my solution would ignore this case, which would perhaps be bad for some people. I guess one could simply check for colspans in the footer - or in fact anywhere in the table, as colspans anywhere would likely break the, However now comes the rub, as I've been here before - I have never successfully submitted a pull request for Joomla as I have never been able to understand how to run the test required and I'm not about to change my personal quirky development routines in order to accommodate them - life is too short. So I am not actually able to submit a pull request once I have it working anyway. I need someone who understands the way of the Joomla to take my code and sprinkle the secret magic testing dust over it. This has been my problem since I wrote my first module for J1.5 (I actually started with 1.0.11, and even briefly tried Mambo before that). If anyone would like to take it on after I have my version working then that would be great. Since footers are never used in core tables I guess it wont matter to most people, and I'll simply bundle my corrected version of |
Beta Was this translation helpful? Give feedback.
-
I've also just noticed that it ( |
Beta Was this translation helpful? Give feedback.
-
My gut feeling here is to say that this is a "wont fix" Having said that if someone was to contribute the code that satisfies your need I would be happy to test it. This is a Feature Request |
Beta Was this translation helpful? Give feedback.
-
Yes I agree Brian. Leave as is and possibly look to add a note somewhere in the documentation that For my own purposes I can adapt the code to work with what I use, and other extension devs can do the same. I'll post whatever I do and link to it here in case someone else stumbles across this problem and can make use of it. I'll leave this open for now to make it easier for others to find. it needs to be tagged as a feature request not a bug |
Beta Was this translation helpful? Give feedback.
-
Did you ever manage to adapt the code? |
Beta Was this translation helpful? Give feedback.
-
Short answer "No" I made a start with getting it to work with In my components I was using I also use Since I've started migrating my components to j5 (a long slow process since I am also generating a couple of new ones which take priority) I have decided to switch to using javascript to freeze the header row of the table in position, and just scroll the rows below it so that the header always remains on the screen (as does the columns tool). Thus I no longer need to have a footer for my tables. The inability to use Stopping the top (header) row of a table scrolling is quite easy and I'd recommend considering implementing it for some of the core components as it certainly enhances the usability (in my opinion). |
Beta Was this translation helpful? Give feedback.
-
So the question then is if this should stay open? |
Beta Was this translation helpful? Give feedback.
-
While my gut feeling is that it should stay open because although the core components are not (currently) affected it is a constraint on using a useful facility (table.columns.js) it will stay hanging around until someone else falls into it. I'm not going to fix it yet awhile, and no-one else has commented. I suspect the more commercial component developers will simply work around it rather than spend time fixing it, and so until some other enthusiast finds it a problem nothing will happen. I would take advice from the grown-ups as to whether this sort of thing should be left open indefinitely, or closed and quietly forgotten about. I can't yet see anywhere obvious in the manual.joomla.org to document it as an issue. Happy to close it if you wish. |
Beta Was this translation helpful? Give feedback.
-
Suggest moving to discussions but can't see how to do that - perhaps a github admin function? @brianteeman |
Beta Was this translation helpful? Give feedback.
-
@rdeutz please move this to discussion as requested |
Beta Was this translation helpful? Give feedback.
-
Steps to reproduce the issue
$wa->useScript('table.columns');
Expected result
The table resizes to fill the width with the specified column hidden in both header, body and footer
Actual result
In the footer the specified column is not hidden, so the table displays with a blank column on the right except in the footer row which displays all the columns thus forcing the space on the right. In this case unless it was the last column that was hidden the footer columns no longer align correctly with the body or header.
System information (as much as possible)
Joomla 5.0.3
php 8.2
Additional comments
Fixing the problem where all of the columns have an entry in the footer row should be fairly starightforward (?!) simply (!!) adding a
this.footers = [].slice.call($table.querySelector('tfoot tr').children);
line at line 10 inmedia/system/js/table.coluns.js
and then doing the same withthis.footers
whereverthis.headers
appears.However handling the situation where there are
colspan="x"
elements in the footer is beyond my pay grade...on the other hand I'm guessing that use of colspan anywhere in the table will break the table.columns facility so perhaps this case can be quietly ignored.The case where there are no colspans, however, is a bug that needs fixing.
Beta Was this translation helpful? Give feedback.
All reactions