これが私のリストビューの一番上です
<asp:ListView ID="ui_lvJobList" runat="server" OnPagePropertiesChanging="ui_lvJobList_PagePropertiesChanging"
OnItemDataBound="ui_lvJobList_ItemDataBound" OnItemCommand="ui_lvJobList_ItemCommand"
OnDataBound="ui_lvJobList_DataBound" OnPagePropertiesChanged="ui_lvJobList_PagePropertiesChanged">
<LayoutTemplate>
<div>
<table class="jobs-table jobs-table-body">
<tbody>
<tr runat="server" id="itemPlaceholder" />
</tbody>
</table>
</div>
</LayoutTemplate>
<ItemTemplate>
<tr id="ui_jobId<%# DataBinder.Eval(Container.DataItem,"JobID") %>" class="<%# DataBinder.Eval(Container.DataItem, "StatusID").ToString() == "1" ? "jobs-row" : "jobs-row-started"%>"
onmouseover="this.style.backgroundColor='#b8e4f7';" onmouseout="this.style.backgroundColor='#efefef';">
<td class="jobs-table-JobId">
<span class="no-decoration cursor-pointer">
<%# DataBinder.Eval(Container.DataItem,"JobID") %>
</span>
</td>
<td class="hidden-ui-control click-me-to-edit">
<asp:LinkButton runat="server" CommandName="EditJob" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"JobID") %>'
ID="ui_btnListViewEditJob" CssClass="no-decoration cursor-pointer">
<%# DataBinder.Eval(Container.DataItem,"JobID") %>
</asp:LinkButton>
</td>
...そして、これが私のjQueryで、任意のセルのダブルクリックを処理します
$("tr[class^='jobs-row'] td").dblclick(function (e) {
e.preventDefault();
$(this).parent().find("td.click-me-to-edit a").click();
});
... jquery-1.8.3 を使用しています
問題: 行をダブルクリックしても OnItemCommand が起動しません。私が含めたよりも多くのセルがありますが、簡潔にするためにそれらを省略しました.
私は preventDefault の有無にかかわらず試してみました。
dblclick 関数がヒットしています。Chrome 開発ツールで実行しました。
ご覧いただきありがとうございます。十分な情報が含まれていない場合はお知らせください。
N