Change "Toggle columns" state to invisible on list load

juuser

Well-Known Member
Hello,

As the title says, is it possible to force the toggle columns state as invisible on list load by default? There seems to be a switch in the default_togglecols.php in list template like:

<a data-toggle-group="<?php echo $group['name']?>" data-toggle-state="open">

That gives me an idea that the data-toggle-state can be also something else than "open".
Although changing "open" to something else (closed, hidden, invisible) does not help. That's probably not the right approach at all.

Thanks in advance!
 
Thanks Hugh, unfortunately not working :( It seems it does change something as now I need to click on the "toggle" button twice to get columns hidden. So the status seems to be something else than "open" before the second click.
 
Yeah, I didn't think it would work.

You'd have to do some work to ...

https://github.com/Fabrik/fabrik/blob/master/media/com_fabrik/js/list-toggle.js

... so it actually checks state and applies toggleColumn() on init. At the moment it just sets up the click handlers to toggle the column in response to a click on a toggle menu item, it doesn't actually do any initial state setup.

Shouldn't be too hard to add some code that goes through all the toggle menu items and apply the current state, on init.

-- hugh
 
Thanks Hugh! I stared the code in list-toggle.js and relized that I have no idea how to proceed with that :( I can write PHP in some level, but Javascript is pretty much dark area for me (done just some very simple things by copy-paste-small modification). Actually I would need to hide just one specific group on list load. If you could give me something more, I might be able to manage. Thanks :)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top