TOPIC:

Formatting and Totals Row 6 months 1 week ago #238961

  • Topic Author
  • hambakwe
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 46
  • Thanks: 0
I've managed to set up a summary list view for a mysql table which gets populated successfully from entries on a Breezing Form.

I wish to achieve three additional things with the list:

1) I want to total the 8th, 9th and 10th columns to a generated total row at the bottom. I've found an example on the forum for a single column and changed it but I'm getting a strange result.

2) I want the totals row to be formatted with ',' separators and have 2 decimal places, I can achieve this in the columns with <?php $value = number_format($value , 2); ?> in 'item wrap' but it does not show in the total row.

The code I'm using for the totals is:

<?php echo '
<script>
jQuery( document ).ready(function() { jQuery("#myTestRow").remove();
var sum = 0; var broj = 0;
jQuery("tbody tr td:nth-child(10)").each(function () { broj = jQuery(this).text();
sum += Number(broj); });
jQuery( "tbody tr:last" ).after("<tr id=\"myTestRow\">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td> "+ sum +"</td>
<td>"+ sum +"</td>
<td>"+ sum +"</td>
<td></td>
</tr>");
});
</script>'; ?>

3) Lastly I'd like the figures to be right justified.

Attached image shows current output.

All help welcome, thanks.
Attachments:

Please Log in or Create an account to join the conversation.

Formatting and Totals Row 5 months 4 weeks ago #239133

  • Topic Author
  • hambakwe
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 46
  • Thanks: 0
Any help or suggestions welcome. Thanks

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.042 seconds

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!