【发布时间】:2011-06-04 15:26:03
【问题描述】:
我使用 Richfaces,其中一个 Rich:dataTable 生成了这个 html:
<form id="scheduleForm">
<table id="scheduleForm:rowList">
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</form>
我想在单击此表的 TR 时采取行动。我怎样才能做到这一点? 以下内容也适用于页面上的其他表格,我也收到了其他行的 alert(),但我不希望这样。
jQuery('#scheduleForm:rowList tr').click(function(event) {
alert(1);
});
关于 ':' 字符。它由 Richfaces 生成。
原代码为:
<h:form id="scheduleForm">
<rich:dataTable id="rowList">
</rich:dataTable>
</h:form>
【问题讨论】:
-
我认为“:”可能在这里播放一些东西。如果我没记错的话,“:”是一些元字符,在选择器中有一些含义。