6 years ago
5
Topic

how to calculate a list in seblod ex.

I have 3 products add to the table

products1 value 10

products2 value 10

products3 value 10

---------------------------------

total            30 - here

Get a VIP membership
4229 Posts
Kadministrator
6 years ago
3
Level 1

6 years ago
2
Level 2

Thanks for the answer

I already accessed this link

What I was thinking is something like the photo.

4229 Posts
Kadministrator
6 years ago
1
Level 3

That would probably require a custom template - or custom javascript to do it on client side, probably javascript would be easier to implement.

6 years ago
0
Level 4

Thanks again, I'll see how javascript.

103 Posts
shubhaanshu
6 years ago
0
Level 1

Hi Friends,

I figured it out in one of my projects like this sometime ago, added these lines of javascript in the templates index file:

<script>
$(window).load(function(){

var sum = 0.0;
$('.total').each(function() 

//.total is the class name for the field to sum
{
sum += parseFloat($(this).text());
});
$("#tableid").append("<tfoot><tr><td colspan='6'>Total: " + sum + "</td></tr></tfoot>");

</script>

-------------

may be it will help you.

Shubhaanshu

Get a Book for SEBLOD