您好,登錄后才能下訂單哦!
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 >統計:</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>
復制代碼
js代碼:
Html代碼
var main_list_size = $(".main_list_size").val();//獲取主單循環大小
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();//沒有數據時,隱藏該行
}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();//有數據時,顯示該行
}
復制代碼
這樣,下面的統計信息就全出來了
原文地址 java社區 http://techfoxbbs.com/thread-2646-1-1.html
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。