jquery中继器行单击不触发
我有一个中继器,我改变鼠标上的行的颜色,效果很好。 我还想在单击功能上选择中继器行值,但单击功能不启动。我尝试过添加断点并进行调试,但调试器根本没有命中断点,代码永远不会执行。没有注册错误。 我的代码如下。我在包含的.js文件中有“Repeater\u selectRow”。我移动了第页上的函数,但它没有启动。是否有其他方法将单击功能附加到行或我是否遗漏了任何内容jquery中继器行单击不触发,jquery,repeater,Jquery,Repeater,我有一个中继器,我改变鼠标上的行的颜色,效果很好。 我还想在单击功能上选择中继器行值,但单击功能不启动。我尝试过添加断点并进行调试,但调试器根本没有命中断点,代码永远不会执行。没有注册错误。 我的代码如下。我在包含的.js文件中有“Repeater\u selectRow”。我移动了第页上的函数,但它没有启动。是否有其他方法将单击功能附加到行或我是否遗漏了任何内容 <asp:Repeater ID="rptResults" runat="server"> <Heade
<asp:Repeater ID="rptResults" runat="server">
<HeaderTemplate>
<div>
<table id="tblPrS" class="prsSearch">
<tr>
<th>Col1</th>
<th>Col2</th>
<th>Col3</th>
<th>Col4</th>
<th>Col5</th>
<th>Col6</th>
<th>Col7</th>
<th>Col8</th>
<th>Col9</th>
</tr>
</HeaderTemplate >
<ItemTemplate >
<tr onclick='javascript:Repeater_selectRow(this,(<%# DataBinder.Eval(Container.DataItem, "Col1") %>));'
style="cursor:hand" onmouseover="style.backgroundColor='LightGrey'"
onmouseout="style.backgroundColor=''">
<td >
<%#DataBinder.Eval(Container.DataItem, "Col1")%>
</td>
<td >
<%#DataBinder.Eval(Container.DataItem, "Col2")%>
</td>
<td >
<%#DataBinder.Eval(Container.DataItem, "Col3")%>
</td>
<td >
<%#DataBinder.Eval(Container.DataItem, "Col4")%>
</td>
<td >
<%#DataBinder.Eval(Container.DataItem, "Col5")%>
</td>
<td >
<%#DataBinder.Eval(Container.DataItem, "Col6")%>
</td>
<td >
<%#DataBinder.Eval(Container.DataItem, "Col7")%>
</td>
<td >
<%#DataBinder.Eval(Container.DataItem, "Col8")%>
</td>
<td >
<%#DataBinder.Eval(Container.DataItem, "Col9")%>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table></div>
</FooterTemplate>
</asp:Repeater>
可乐
可乐
可乐
可乐
可乐
可乐6
可乐
可乐
可乐
您的留言中没有足够的信息来发布更具体的答案,但这可能对您有所帮助
我将从标记中删除整个onclick,并像这样使用jQuery:
$("tr").click(function() {
//Do your thing
});
“点击功能不启动”信息不足,控制台有错误吗?您是否在浏览器的调试器中添加了断点?还有另一种方法,用JavaScript而不是HTML属性连接单击。没有错误。我尝试在函数上设置断点,但没有成功。函数似乎在单击行时未绑定到。