2011-10-24 7 views
1

私は現在Siwappの0.5バージョンで作業していますが、私は請求書テーブルの各行に支払ボタンのポップオーバーを表示しようとしています。しかし、私はそれをクリックで行う必要があります。私が設定されている場合、私はそれが動作トリガ「マニュアル」を削除した場合クリックでポップオーバーを表示するには?

<table class="zebra-striped align-middle" data-type="invoices"> 
    <colgroup> 
    <col /> 
    <col /> 
    <col class="date" /> 
    <col class="date" /> 
    <col class="status" /> 
    <col class="currency" /> 
    <col class="currency" /> 
    <col class="payments" /> 
    </colgroup> 
    <thead> 
    <tr> 
     <th>{% trans %}Number{% endtrans %}</th> 
     <th>{% trans %}Customer{% endtrans %}</th> 
     <th>{% trans %}Date{% endtrans %}</th> 
     <th>{% trans %}Due Date{% endtrans %}</th> 
     <th>{% trans %}Status{% endtrans %}</th> 
     <th>{% trans %}Due{% endtrans %}</th> 
     <th>{% trans %}Total{% endtrans %}</th> 
     <th></th> 
    </tr> 
    </thead> 
    <tbody> 
    <tr> 
     <td>ASET-22</td> 
     <td>Roxxon</td> 
     <td>5/28/11</td> 
     <td>9/16/11</td> 
     <td> 
     <span class="label important">{% trans %}overdue{% endtrans %}</span> 
     </td> 
     <td></td> 
     <td>$11,435.23</td> 
     <td> 
     <a href="{{ path('invoice_payments', { 'invoiceId': 4 }) }}" class="btn secondary icon clock payments" title="Payments">{% trans %}Payments{% endtrans %}</a> 
     </td> 
    </tr> 
    </tbody> 
</table> 

しかし:テーブルのHTMLは、この(末尾のリンクを参照)のようなものです

jQuery(function($){ 

    $('table[data-type="invoices"] a.payments').popover({ 
    live: true, 
    placement: 'left', 
    offset: 5, 
    html: true, 
    content: function() { 
     return $(this).attr('class'); 
    }, 
    trigger: 'manual' 
    }).live('click', function(e){ 
    e.preventDefault(); 
    $(this).popover('show'); 
    }); 

}); 

:私は、次のJSコードを持っていますそれはそうではありません。

誰でもこの方法を知っていますか?ありがとう!

答えて

7

Popoverは、手動で何をしているのかを自動的に処理します。おそらく奇妙な競合を引き起こしています。あなた自身がそれを行うことができるときにあなた自身のクリックハンドラを不必要に追加しており、必要ではないと思われるセットアップ機能全体をラッピングしています。

$('table[data-type="invoices"] a.payments').popover({ 
    live: true, 
    placement: 'left', 
    offset: 5, 
    html: true, 
    content: function() { 
    return $(this).attr('class'); 
    }, 
    trigger: 'manual' 
}); 
関連する問題