Home > front end >  In thymeleaf each loop
In thymeleaf each loop

Time:10-07

Scenario: shopping website of the shopping cart page, need to display the unit price, quantity, total price (both product)

In the outermost div is thymeleaf each loop,
Take out the unit price from the database, the number is input in the front,
How to put the total price displayed,

JS can achieve, but I don't know how to calculation in that each loop, JS code into the each loop?
If no JS, it's pure label implementation, the thymeleaf how to obtain the value of the other controls? (I feel no)
If they don't have, then can only put the "quantity" in database, then operation, it is very very very bad...
Hope to get the solution, thank you,

[here is what I want effect, taobao shopping cart screenshot]
  • Related