Keep table groups expanded

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
rlandto
Posts: 5
Joined: 2018-11-28 14:13

Keep table groups expanded

Post by rlandto » 2020-02-25 07:14

What do I need to change to get all table groups expanded at startup?
I would like to keep empty table groups hidden.

I guess the answer might be in home.php, but I am not expert enough to get it.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Keep table groups expanded

Post by pbottcher » 2020-02-25 19:03

Hi,

you can try adding to the hooks/header-extras.php:

Code: Select all

<?php $is_homepage = (basename($_SERVER['PHP_SELF']) === 'index.php' && !isset($_REQUEST['signIn'])); if ($is_homepage) { ?>
    <script>
        $j(function() {
             $j('.collapse').addClass('in');$j('.collapser').children('.glyphicon').toggleClass('glyphicon-chevron-right glyphicon-chevron-down');
        })
    </script>
<?php } ?>
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rlandto
Posts: 5
Joined: 2018-11-28 14:13

Re: Keep table groups expanded

Post by rlandto » 2020-02-25 21:43

Hi pböttcher

Thx a lot for your reply.
It kinda works, but inverts the scene.
So the main table group is now colappsed, while the other ones are expanded.

Do you have a final hint how to expand all, but the empty ones?

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Keep table groups expanded

Post by pbottcher » 2020-02-25 22:14

Hi,

true, sorry, overlooked that.

Try not adding to the header, but the footer-extras.php the corrected version:

Code: Select all

<?php $is_homepage = (basename($_SERVER['PHP_SELF']) === 'index.php' && !isset($_REQUEST['signIn'])); if ($is_homepage) { ?>
    <script>
        $j(function() {
             $j('.collapse').not('.in,.navbar-collapse').addClass('in');$j('.collapser').not(':first').children('.glyphicon').toggleClass('glyphicon-chevron-right glyphicon-chevron-down');
        })
    </script>
<?php } ?>
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rlandto
Posts: 5
Joined: 2018-11-28 14:13

Re: Keep table groups expanded

Post by rlandto » 2020-02-26 07:20

Awsome.
Works like a charme.
Thank you so much.

Post Reply