TOPIC:

Formatting and Totals Row 2 weeks 23 hours ago #245914

  • Topic Author
  • hambakwe
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 54
  • Thanks: 0
Thanks so much - we tried this but it is throwing up a Page not found error. I can't see any obvious reason why but clearly you got it running with no problem. Which field should we add it to? We tried '1100' Fund Balance and a couple of others. I'm sure it is something simple I have missed. Thanks Martin.

We added this:

<?php echo '
<script>

jQuery( document ).ready(function() {

jQuery("#myTestRow").remove();

var sum = 0;
var sum2 = 0;
var sum3 = 0;
var broj = 0;

jQuery("tbody tr td:nth-child(8)").each(function () {
broj = jQuery(this).text();
console.log(broj);
sum += Number(broj);
});

jQuery("tbody tr td:nth-child(9)").each(function () {
broj = jQuery(this).text();
console.log(broj);
sum2 += Number(broj);
});

jQuery("tbody tr td:nth-child(10)").each(function () {
broj = jQuery(this).text();
console.log(broj);
sum3 += 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.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") +'</td>' +
'<td>' + sum2.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") +'</td>' +
'<td>' + sum3.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") +'</td>' +
'<td></td>' +
'</tr>');
});

</script>'; ?>

Attachments:

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

Formatting and Totals Row 2 weeks 21 hours ago #245930

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9789
  • Karma: 167
  • Thanks: 785
Hi,

I assumed you were putting your original code already as <script> tag in a template override for the list view? You would simply replace it if that's the case.

The only syntax changed I added was not breaking the strings with these empty <td> tags but breaking them using + "<td></td>" + so there won't be no js error.

Maybe you are pasting it in a way that it interferes with the PHP syntax or something?

Regards,
Markus

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

Formatting and Totals Row 1 week 6 days ago #246059

  • Topic Author
  • hambakwe
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 54
  • Thanks: 0
Marcus, thanks so much - took a bit of time trying more, less or different " ' or + formats.

This version works reliably as a wrap code:

<?php
echo '
<script>
jQuery( document ).ready(function() {
jQuery("#myTestRow").remove();
var sum = 0;
var sum2 = 0;
var sum3 = 0;
var sum4 = 0;
var broj = 0;

jQuery("tbody tr td:nth-child(7)").each(function () { broj = jQuery(this).text(); console.log(broj); sum4 += Number(broj); });
jQuery("tbody tr td:nth-child(8)").each(function () { broj = jQuery(this).text(); console.log(broj); sum += Number(broj); });
jQuery("tbody tr td:nth-child(9)").each(function () { broj = jQuery(this).text(); console.log(broj); sum2 += Number(broj); });
jQuery("tbody tr td:nth-child(10)").each(function () { broj = jQuery(this).text(); console.log(broj); sum3 += Number(broj); });
jQuery( "tbody tr:last" ).after("<tr id=\"myTestRow\">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td> "+ sum4.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") +"</td>
<td> "+ sum.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") +"</td>
<td> "+ sum2.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") +"</td>
<td> "+ sum3.toFixed(2).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") +"</td>
<td></td>
</tr>");
});
</script>';
?>

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

Formatting and Totals Row 1 week 6 days ago #246068

  • Topic Author
  • hambakwe
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 54
  • Thanks: 0
Hi Markus, Last (hopefully quick) point. How can I right justify all the numbers in this list view. Thanks and best, Martin

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

Formatting and Totals Row 1 week 5 days ago #246085

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 9789
  • Karma: 167
  • Thanks: 785
Hi,

a little bit of CSS should do it (table headers):
.cbListView table th{
   direction: rtl;
}

table cells:
.cbListView table td{
   direction: rtl;
}

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

Last edit: Post by TheMuffinMan.

Formatting and Totals Row 1 week 5 days ago #246102

  • Topic Author
  • hambakwe
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 54
  • Thanks: 0
Do I need to switch to a new templ on the menu item (for example listone.php) and then add the css snippets you have provided into that?

If so, where in the listone.php templ do I insert this code?

Thanks for your patience, I'm new to this level of work with BF/CB but I'm very much enjoying the learning process!

Best, Martin

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

Moderators: ForumSupport
Time to create page: 0.076 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

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!