See this code
defaultContent: '<i class="fa fa-close pull-right js-customer-delete"style="color: #0066FF; text-decoration: none; cursor: pointer; margin-left:10px"data-id=""data-url=""></i> <i class="fa fa-edit pull-right js-customer-edit"style="color: #0066FF; text-decoration: none; cursor: pointer"data-id=""data-url=""></i>'
defaultContent: '<i class="fa fa-close pull-right js-customer-delete"style="color: #0066FF; text-decoration: none; cursor: pointer; margin-left:10px"data-id=""data-url=""></i> <i class="fa fa-edit pull-right js-customer-edit"style="color: #0066FF; text-decoration: none; cursor: pointer"data-id=""data-url=""></i>'
I can insert an extra column into the DataTable with whatever value I want.
I've been able to insert a class into 'tr' (which is a row
) ...
$(row).addClass('tr-customer');
But I can not insert a 'data-id' and 'data-url' into this 'row'.
I've tried
$(row).data('id', 'valor_qualquer')
But it does not.
Question: How do I insert a 'data-id' and 'data-url' into the 'tr' from the DataTable?
Expected result:
<tr class="tr-customer" data-id="" data-url=""></tr>