您好,登錄后才能下訂單哦!
jsp代碼:
Html代碼
<c:forEach var="main" items="${mainPage.list }">
<tr>
<td><a class="sceneStr_td">${main.sceneStr }</a></td>
<td class="concern">${main.concernedNumber }</td>
<td class="noConcern">${main.noConcernedNumber }</td>
<td class="validateNumber">${main.validateNumber }</td>
<td>${main.createTime }</td>
<td>${main.delFlag==0?'允許':'不允許' }</td>
<td>
<a href="${main.url }" target="_blank">二維碼鏈接</a>
</td>
</tr>
</c:forEach>
<tr class="count_main">
<th >統(tǒng)計(jì):</th>
<td class="count_concern">0</td>
<td class="count_noConcern">0</td>
<td class="count_validateNumber">0</td>
<td></td>
<td></td>
<td></td>
</tr>
復(fù)制代碼
js代碼:
Html代碼
var main_list_size = $(".main_list_size").val();//獲取主單循環(huán)大小
main_list_size = parseInt(main_list_size);
var count_concern = parseInt(0);
var count_noConcern = parseInt(0);
var count_validateNumber = parseInt(0);
if(main_list_size<=0){
$(".count_main").hide();//沒(méi)有數(shù)據(jù)時(shí),隱藏該行
}else{
var concern = $(".concern noConcern validateNumber");
for(var i=0;i<main_list_size;i++){
count_concerncount_concern = count_concern+ parseInt($(".concern").eq(i).html());
count_noConcerncount_noConcern = count_noConcern + parseInt($(".noConcern").eq(i).html());
count_validateNumbercount_validateNumber = count_validateNumber + parseInt($(".validateNumber").eq(i).html());
}
$(".count_concern").html(count_concern);
$(".count_noConcern").html(count_noConcern);
$(".count_validateNumber").html(count_validateNumber);
$(".count_main").show();//有數(shù)據(jù)時(shí),顯示該行
}
復(fù)制代碼
這樣,下面的統(tǒng)計(jì)信息就全出來(lái)了
原文地址 java社區(qū) http://techfoxbbs.com/thread-2646-1-1.html
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。