# How can I calculate sum of elements (container html)?

## How can I calculate sum of elements (container html)?

Hi! I have a big container (BC) which containts many containers (MC) and some buttons. MC also containts some numberfields, container with sum of these numberfields (SN) and some buttons which are coupled in another container. I need to calculate final sum of SN for each MC.

A structure for the best understanding:
Big Container (dish)
_____________________________________________
| ______________________________
| | Ingredient (2 numberfields + container with sum in html)
| |_________________
| | Ingredient
| |_________________
| | Ingredient
| |_________________
| | Button
| |_________________
| | Button
| |_________________
| ______________________________
| | Ingredient
| |_________________
| | Ingredient
| |_________________
| | Ingredient
| |_________________
| | Button
| |_________________
| | Button
| |_________________
|Button1
|Button2
Code:
```calculateTotalDish: function(numberfield){
if ((container.items != undefined)
&& (container
.down('container[name=finalPrice]')))
console.log(container.down('container[name=finalPrice]'));
});```
This code is wired to change event of numberfield. In console I see the value of the first

2. Why not calculate the values from the store directly?

Scott.

## how to calculate the values from the store directly

can you give us an example how to calculate the values from the store directly?

4. You could calculate the fields at the table level using SQL, or you could perform it at the client level:
http://jsfiddle.net/RMfzF/1/

Scott.

5. thank you Scot,
i use architekt, so i aded a new field in the model num3 then a a convert function:
var num1 = rec.get('num1')
var num2 = rec.get('num2');
return num1+num2;

so num3 can calculate num1+num2
perfect.
greatings
isaid

6. Fortunately, I also encountered this problem as you

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar