我对内部事件有问题
datatable
.
我有一个表,在几列中,我有锚定标记,例如:
<tr role="row" class="odd">
<td class="sorting_1">1</td>
<td>4.000,00</td>
<td>
<a class="js-details" id="9">
<p class="blue-text">Ver detalle</p>
</a>
</td>
<td>04/09/2017</td>
<td>
<a class="icon-checkmark"></a>
<a class="icon-x red-text js-payment-rejected" href="#" id="9" title="Rechazar el Pago"></a>
</td>
</tr>
$('.js-payment-approved').click ->
payment_document_id = $(this).attr('id')
$.get("#{approved_payment_documents_path}", payment_document_id: payment_document_id)
$('.js-payment-rejected').click ->
payment_document_id = $(this).attr('id')
$.get("#{rejected_payment_payment_documents_path}", payment_document_id: payment_document_id)
如果我点击事件不会触发的任何锚定标签,我在datatable论坛上读到,我应该这样做
this
:
$('.approved-datatable').on 'tr', 'click', (e) ->
$('.js-payment-rejected').click ->
payment_document_id = $(this).attr('id')
$.get("#{rejected_payment_payment_documents_path}", payment_document_id: payment_document_id)
有什么办法解决这个问题吗?