2 回答

TA贡献1783条经验 获得超4个赞
在每个功能上,当您更新小计时,您还将获得每个小计,并将所有这些总和相加并放入小计。请按照以下步骤操作:-
在grand_total()函数中获取每个小计的值
function grand_total(){
var grand_total = parseInt($("#ew_qty_sub_total").text());
grand_total += parseInt($("#con_qty_sub_total").text());
grand_total += parseInt($("#rein_qty_sub_total").text());
.
.
.
grand_total += parseInt($("#weather_sheild_qty_sub_total").text());
grand_total += parseInt($("#decorative_surface_qty_sub_total").text());
$("#grand_total").text(grand_total);
}
在每个keyup / mouseup函数中调用此函数。像这样:-
$("#ew_qty1").bind('keyup mouseup',function ()
{
var rate = 12;
// Take Quantity from user
var qty = $("#ew_qty1").val();
// Multiply Quantity By 10
var val = qty*rate;
// Set Text In TD
$("#ew_qty1_td").text(val);
sub_total_of_earth_Work();
grand_total(); //call for total of sub total
});
添加回答
举报