Remove Aggregate Label

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Bishu
User
Posts: 429

Remove Aggregate Label

Post by Bishu »

I have a aggregate field with count

On the aggregate cell it is written as Count 10
How can I remove this Count and show only 10

and also I would like to change the background color of this cell only.


mobhar
User
Posts: 11723

Post by mobhar »

  1. You may simply put the following code in "Page_Load" that belongs to the List Page:

Language()->setPhrase("Count", "");

  1. Then, simply also put the following code in "Startup Script" that belongs to the List Page:

$("span").removeClass("ewAggregate");


Bishu
User
Posts: 429

Post by Bishu »

Thanks sir for your help.

by using Language()->setPhrase("Count", ""); it change all the "Count"
I am using Aggregate to 3 fields. I would like to change only for 1 field.


mobhar
User
Posts: 11723

Post by mobhar »

If you obviously want to remove the aggregate label only for the certain field(s), then you need remove the PHP code in "Page_Load" server event above, and then make sure you have already included the row id of the field in the "Startup Script" code, for example:

// assume the table name is "table1" and the field name is "Jumlah1", adjust it to yours
$("td #elf_table1_Jumlah1 span").removeClass("ewAggregate");
$("td #elf_table1_Jumlah1 span").html("");


arbei
User
Posts: 9383

Post by arbei »

You can try to hide the the <span> with the aggregate class by the column field name.

For example, if the "Count: " is exists under the field "model" column, you can hide it by below code.

$('[data-name="models"]').find(".ewAggregate").hide();

[data-name="models"] will select all the TD of the model field.
.find(".ewAggregate") will get the <span> with class="ewAggregate" and hide it.


mobhar
User
Posts: 11723

Post by mobhar »

Thanks, arbei. That's much better, too. :-)


Post Reply