Right justify Totals

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

Right justify Totals

Post by juvat »

How do I right justify the total in a list page within phpmaker (11.0.5) so that it is displayed under the numbers that appear above it? Currently it left justified.


mobhar
User
Posts: 11768

Post by mobhar »

Simply put the following PHP code in "Row_Rendered" server event:

// assume your field name is "Quantity" (adjust it with yours)
if ($this->RowType == EW_ROWTYPE_AGGREGATE) {
$this->Quantity->ViewValue = "<div style='text-align: right; font-weight: bold;'>".$this->Quantity->ViewValue."</div>";
}

If you would like also to hide the "TOTAL" text in that row, then simply put the following jQuery code in "Startup Script" under "Client Scripts" -> "Table-Specific" -> "List Page":

$(document).ready(function() {
$(".ewAggregate").hide();
});


juvat
User
Posts: 71

Post by juvat »

Thanks for the quick reply... I've been trying to get this down for awhile. Your suggestion worked perfectly.


Webmaster
User
Posts: 9430

Post by Webmaster »

Instead of using server event, you can also use Startup Script and jQuery to select the TD with aggregate ( see http://api.jquery.com/has-selector/) and add your "text-align" CSS style, e.g.

$("td:has(.ewAggregate)").css("text-align", "right");


Post Reply