Java代碼
原理上就是tr的綁定觸發事件。
Java代碼
Java代碼
//點擊鼠標觸發單行明細顯示
$(function(){
$("#demo tr").bind('click', function() {
var node = $(this);
var list_RowIdNodes = node.find("input[name='row_id']").val() ;
//alert(list_RowIdNodes);
selectrow(list_RowIdNodes);
});
});
以下為JSP列表的寫法。
Java代碼
<tr>
<td valign="top">
<div style="OVERFLOW-Y: auto; OVERFLOW-X: auto; HEIGHT: 200px ; WIDTH: 100%;">
<form name="pageform" action="<s:url value='/common/commonPage'/>" method="post">
<page:toolbar name="list" formname="pageform" listJspPage="/pages/admin/management/user/listUser.jsp" beanid="cb"
toolBarShow="false" border="0" pagesize="5" listTableId="demo" width="100%" styleClass="table_border">
<page:checkbox id="cb" name="row_id" isNo="true" styleClass="rightcss" titleEvent="onclick='selectBox(this)'" property="row_id" colunmName="Select" />
<page:colunm id="cb" colunmName="User ID" colunmId="login_name" isOrderBy="true"></page:colunm>
<page:colunm id="cb" colunmName="User Name" colunmId="user_name" isOrderBy="true"></page:colunm>
<page:colunm id="cb" colunmName="Position" colunmId="pos_name" isOrderBy="true"></page:colunm>
<page:colunm id="cb" colunmName="Department" colunmId="dept_name" isOrderBy="true"></page:colunm>
<page:colunm id="cb" colunmName="User Status" colunmId="user_status_name" isOrderBy="true"></page:colunm>
</page:toolbar>
</form>
</div>
<script language="JavaScript">
anole('demo',1,'#F3F3F3','#F9F9F9','#d9e8fb','#B4D0F8');
</script>
</td>
</tr>
作者“ticojj”