changing column with recordcount

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
User avatar
RonP
Veteran Member
Posts: 258
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

changing column with recordcount

Post by RonP » 2025-02-09 12:32

Hi,

The need option "Show record count in Homepage" is very functional.
I'm looking for a way to adjust the column with.
Where to do so?

Ron

User avatar
RonP
Veteran Member
Posts: 258
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: changing column width recordcount

Post by RonP » 2025-03-24 15:20

Hi,

Is a solution nearby :oops:
Ron

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

Re: changing column with recordcount

Post by pbottcher » 2025-03-26 06:44

Hi Ron,

what do you want to adjust?

You can select the number of entries shown in a row (between 1 - 4 ).

If you want to change the size of the size of the badge you can try to put something like

Code: Select all

<style>
.table_links .badge {
	scale: 1.4;
}
</style>
in the hooks/footer-extras.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.

User avatar
RonP
Veteran Member
Posts: 258
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: changing column with recordcount

Post by RonP » 2025-03-26 10:51

Hi pbottcher,
Thanks for your reply.
I've used your suggestion however ... now expected result.

Maybe the screen dump clears things out.

As the count mostly is < 10 I like to adjust the width, in Tabel View, of the Record Count columns
Width_recordcount_TV.jpg
Width_recordcount_TV.jpg (33.89 KiB) Viewed 29080 times

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

Re: changing column with recordcount

Post by pbottcher » 2025-03-29 08:16

Hi Ron,

thanks for clarifying, that helps :-)

you may play with this css selector:

Code: Select all

<style>
	table [data-table] {
		width:400px;
	}
</style>
put it in the header-extras.php

or if you address only a specific table you may try

Code: Select all

	table[data-tablename="TABLENAME"] [data-table] {
		width:200px;
	}
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.

User avatar
RonP
Veteran Member
Posts: 258
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: changing column with recordcount

Post by RonP » 2025-03-29 13:05

Hi pbottcher,

Thanks again, however
I tried both suggestion but I don't see any effect.
I've put the code the "Hooks directory" and later on in de "root directory"

Ron

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

Re: changing column with recordcount

Post by pbottcher » 2025-03-29 15:26

Hi Ron,

can you share where you put the code.
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.

User avatar
RonP
Veteran Member
Posts: 258
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: changing column with recordcount

Post by RonP » 2025-03-31 11:39

Hi pbottcher

In de Hooks directory Header-extras.php
The width should be for table contacten

Code: Select all

<style>
	 
	table[data-tablename="contacten"] [data-table] {
		width:200px;
	}
</style>
No changes seen

After that
In de Main directory Header-extras.php

Code: Select all

<style>
	table [data-table] {
		width:200px;
	}
</style>
No changes seen

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

Re: changing column with recordcount

Post by pbottcher » 2025-04-01 06:08

HI Ron,

can you chech in the developers tool the tablename you are using. In my example the tablen is calles contribution and the code in the hooks/header-extras is:

Code: Select all

<style>
	 
	table[data-tablename="contribution"] [data-table] {
		width:500px;
	}
</style>

<?php
Just for testing, put the style code to the top of your header-extras.php file, before the <?php tag.

tablename.png
tablename.png (3.51 KiB) Viewed 27946 times
This expands the table column correctly to 500px on my system.
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.

User avatar
RonP
Veteran Member
Posts: 258
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: changing column with recordcount

Post by RonP » 2025-04-02 13:21

Hi pbottcher,

The "overrule" is correct however I don't see any column width adjustments
Overruled_width.png
Overruled_width.png (183.21 KiB) Viewed 27759 times
Ron

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1944
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: changing column with recordcount

Post by jsetzer » 2025-04-02 14:15

Sorry, I think the CSS selector should be different.

Given table name = services and column name = name, the following code can be used to set the width of column services-name to 600px:

Code: Select all

<!-- file: hooks/header-extras.php -->
<style>
    table[data-tablename="services"]>tbody>tr>td.services-name {
        min-width: 600px;
    }
</style>
chrome_4uayIN6R2R.png
chrome_4uayIN6R2R.png (155.53 KiB) Viewed 27754 times
You can play around with min-width, max-width, width and, obviously, change 600px to something different like 30% or any valid CSS size value.

---
If this is a default table view (as long as you don't have multipe tables in the same page), this can be even easier:

Code: Select all

<!-- file: hooks/header-extras.php -->
<style>
    /* given: table name = "services" and column name = "name" */
    table[data-tablename] .services-name {
        min-width: 600px;
    }
</style>
I hope this helps!
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 25.10 + all AppGini Helper tools

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

Re: changing column with recordcount

Post by pbottcher » 2025-04-06 09:26

Hi again,

not sure why it would not work. I think you are talking about the reference columns in the table.

You may check in your setting:

As example I use the basetable to be adressed with 2 reference columns ( reftable and reftable_1)
references.png
references.png (13.63 KiB) Viewed 26111 times


without styling:
reference_standard.png
reference_standard.png (26.58 KiB) Viewed 26111 times
and with applied styles in the hooks/header-extras.php file:

Code: Select all

<style>
	table[data-tablename="basetable"] [data-table] {
		width:20px;
		background: lightgray;
	}
	table[data-tablename="basetable"] [data-table="reftable_1"] {
		width:200px;
		background: lightblue;
	}
</style>

reference_style.png
reference_style.png (137.38 KiB) Viewed 26111 times
The first style would be applied to all columns, the second one only to the reftable_1 column.
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.

User avatar
RonP
Veteran Member
Posts: 258
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: changing column with recordcount

Post by RonP » 2025-04-06 12:07

Hi Guys,

Thank you for thinking with me :)

I've found a very simple solution:
I've adjusted the "Tab/Column Title in "box" Parent/Children settings.

Likewise for the other Tab/Column Titles

Ron
Attachments
Width-Solution.JPG
Width-Solution.JPG (118.15 KiB) Viewed 26092 times

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

Re: changing column with recordcount

Post by pbottcher » 2025-04-06 15:46

Hi Ron,

great that you found a solution. Out of curiosity, you do not have ticked the box for "Show count of children in table view (TV)".
childcount.png
childcount.png (22 KiB) Viewed 26081 times
So to which width are you refering?
My thought was that we talk about this column, that will be added to the TV.
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.

User avatar
RonP
Veteran Member
Posts: 258
Joined: 2013-08-27 13:36
Location: Heiloo, The Netherlands
Contact:

Re: changing column with recordcount

Post by RonP » 2025-04-07 09:34

Hi pbottcher

That was "sharp" of you!
Now that you mention it I didn't pay attention at it, however it occurred some versions ago.

I just activated the "Count in TV" and that went well, numbers appeared.
After that I deactivated the Count, however, the columns are still shown, with no values in the columns.

Ron
Width-show_count_TV.JPG
Width-show_count_TV.JPG (105.93 KiB) Viewed 25919 times

Post Reply