使用jquery折叠列表数据

$(document).ready(function() {
			$("tr[id*='child']").css("display","none");
			$('tr.parent').css("cursor","pointer").attr("title","点击这里展开/关闭").click(function(){
				$(this).siblings('.child-'+this.id).toggle();
				
				
			});
		});
	<table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
		<thead>
			<tr>
				<th> 选择 </th>
				<th class="sort-column remarks">临时凭证号</th>
				<th class="sort-column remarks">费用类型</th>
				<th class="sort-column remarks">费用编号</th>
				<th class="sort-column remarks">费用归属公司</th>
				<th class="sort-column remarks">流程名称</th>
				<th class="sort-column remarks">申请人</th>
				<th class="sort-column remarks">申请时间</th>
				<th class="sort-column remarks">报销金额</th>
			</tr>
			
			
		</thead>
		<tbody>
		
		<c:forEach items="${page.list}" var="handleReverse">
			 <c:choose> 
				<c:when test="${handleReverse.judge}">
					<tr class="parent" id="${handleReverse.processNo}">//父
					<td><input type="radio" name="payRefNo" value="${handleReverse.payRefNo}" id="${handleReverse.id}" /></td>
				</c:when>
				<c:otherwise>
					<tr class="child-${handleReverse.processNo}" id="child">//子
					<td></td>
				</c:otherwise>
			</c:choose>				
				<td>${handleReverse.voucherNo}</td>
				<td>${handleReverse.costType}</td>
				<td>${handleReverse.processNo}</td>
				<td>${companyName}</td>
				<td>${handleReverse.processDefName}</td>
				<td>${handleReverse.applyUserName}</td>
				<td><fmt:formatDate value="${handleReverse.payRefDate}" pattern="yyyy-MM-dd" /></td>
				<td>
					<input type="hidden" name="centerCode" value="${handleReverse.centerCode}" />
					<input type="hidden" name="branchCode" value="${handleReverse.branchCode}" />
					<p style="text-align:right"><fmt:formatNumber value="${handleReverse.realPayCost}" pattern=".00"/></p>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值