I have calculated the sum of the column of the table in jQuery and return the total value to thymeleaf view. How can i set the total value to in a Java model object.
JQuery Code:
$(function(){
var grandTotal= 0;
$("[id*=BuildingAsf]").each(function(){
grandTotal=grandTotal+parseFloat($(this).html());
// alert( $( this ).text() );
});
totalBuildingAsf.html(grandTotal);
});
HTML Code :
`<tr><td th:text="#{apx1_p1_pu_row_1_lbl}"></td>
<td id="total-Building-asf" class="total-Building-asf" th:text="*{entityDetailRow.totalAsfBuilding.formattedValue}"></td></tr>`