私は、クリックするとより多くのコンテンツを表示する拡張セクションのテーブルを利用できるようにするプラグインを使用しています。jQuery展開テーブルの行
プラグインが機能している間、私はコードの一部を微調整しようとしており、それを正しく得ることはできません。
行全体にクリックイベントがあり、行にリンクが含まれている場合はリンクに移動して、望ましくない行を展開します。私は、拡張矢印をクリックするとクリックイベントが発生するようにしたいと思います。
$('.table-expandable').each(function() {
var table = $(this);
table.children('thead').children('tr').append('<th></th>');
table.children('tbody').children('tr').filter(':odd').hide();
// This is the event that is linked to the whole table row
table.children('tbody').children('tr').filter(':even').click(function() {
var element = $(this);
element.next('tr').toggle('slow');
element.find(".table-expandable-arrow").toggleClass("up");
});
table.children('tbody').children('tr').filter(':even').each(function() {
var element = $(this);
element.append('<td><div class="table-expandable-arrow"></div></td>');
});
});
は、私がイベントにロジックの別の部分に追加してみましたが、それは動作しませんでした:私はしようとすることができるものの
table.children('tbody').children('tr').filter(':even').find('.table-expandable-arrow').click(function() {
任意のアイデアを矢印ができるトリガを代わりに全体の行?
更新:
<tr class="primaryValue ">
<td class="small"><a target="_BLANK" href="tool.php?tool=30">30</a></td>
<td class="small">Quickload</td>
<td class="small">Web</td>
<td class="small">John Doe</td>
<td class="small"><a href="mailto:[email protected]">[email protected]</a></td>
<td class="small">Omaha</td>
<td class="small">123456</td>
<td class="small">N/A</td>
<td>
<div class="table-expandable-arrow"></div>
</td>
</tr>
あなたのhtmlの構造は何ですか?どの要素が「拡張矢印」ですか? – Dekel
@Dekel行のコードスニペットを追加しました – SBB
フィドルを提供する機会はありますか? – Aer0