Answer the question
In order to leave comments, you need to log in
How to make a table row a link via dataTables angular?
In general, the task is the following - to make table rows clickable.
Specifically, when you click on a line, the page should be redrawn.
The output of the table is implemented like this:
import '../../certificates/services/Certificate';
import './template.html';
angular.module('desktop').component('certificates', {
templateUrl: NAMESPACE_DESKTOP + `components/Certificate/template.html`,
controller: Certificates
});
function Certificates(Certificate, $stateParams) {
$.extend($.fn.dataTable.defaults, {
language: {
processing: ''
}
});
$('.js-datatable-certificates').dataTable({
"processing": true,
"ajax": '/desktop/api/certificates/' + $stateParams.record_id,
"columns": [
{ data: 'cert_id'},
{ data: 'name' },
{ data: 'date' },
{ data: 'created_by' },
{ data: 'modified' }
]
});
}
<h3>Certificates</h3>
<div class="table-responsive">
<table class="table table-hover table-striped table-bordered js-datatable-certificates">
<thead>
<tr>
<th>Certificate id</th>
<th>Name</th>
<th>Date</th>
<th>Created by</th>
<th>Modified Date</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question