Keep Table Group Expanded at the Startup(to be controlled by user)

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
skumar
Posts: 5
Joined: 2018-11-14 17:50

Keep Table Group Expanded at the Startup(to be controlled by user)

Post by skumar » 2018-12-05 16:24

Hi,
Pls refer the screen shot; I want to control the Table Expanded or Not at the Startup of Home Page Load based on on the Check box Status(check box status will be stored in database). Kindly help me in coding.
check box.png
check box.png (102.81 KiB) Viewed 455 times
Regards,
SAMPATH

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 377
Joined: 2018-04-01 10:12

Re: Keep Table Group Expanded at the Startup(to be controlled by user)

Post by pböttcher » 2018-12-09 15:06

Hi,

you can try to add this to your hooks/footer-extras.php. Note, this is no full code, only the idea

## get the "keep Expanded" Checkbox status for your tablegroup.

KeepExpanded = value of checkbox for LABEL

If (KeepExpanded == 1) // Keep Expanded checkbox is checked
{
$j('a:contains("LABEL")').click();
}

Where LABEL would be MBBS ACADEMIC ACCOUNTS according to your screenshot.

Hope that helps.

skumar
Posts: 5
Joined: 2018-11-14 17:50

Re: Keep Table Group Expanded at the Startup(to be controlled by user)

Post by skumar » 2018-12-10 15:56

Thank u for your replay.
But how to place the "keep Expanded" Checkbox at that location?
Regards,
SAMPATH

User avatar
a.gneady
Site Admin
Posts: 992
Joined: 2012-09-27 14:46
Contact:

Re: Keep Table Group Expanded at the Startup(to be controlled by user)

Post by a.gneady » 2019-01-09 14:05

Hmm ... you can use hooks/footer-extras.php to inject any element into any page using JavaScript. The general idea is to find a suitable selector in the page, using the inspector of your browser, and then insert your element inside/after/before that selector. So, for this example, every table link in the homepage has an id like "tablename-tile" ... So, you could inject the checkbox after "Uncleared transactions" panel like this (code in footer-extras.php):

Code: Select all

<script>$j(function() {
    $j('#uncleared_transactions-tile').after('<input type="checkbox"> Keep expanded');
})</script>
The above is a basic example you can expand on ... I assumed the table name is uncleared_transactions.
:idea: Learn all the tips and tricks of customizing AppGini apps through our online course.

:arrow: Summary Reports plugin enables you to build powerful reports and charts inside your AppGini application through a few simple steps. See the big picture and discover trends in your data that empower you to take the right decisions confidently.

:arrow: Search Page Maker enables you to build user-friendly yet powerful search pages for your AppGini application by simply dragging and dropping the fields you want to include in search.

Post Reply