I'm using AngularJs to create my frontend project. My goal is to create dinamically N datatables within uib-accordion, uib-accordion-group elements, in this way:
<uib-accordion class="" close-others="true">
<div uib-accordion-group class="panel-default" ng-repeat="service in orderOrganizerCtrl.tableServiceIdFilter">
<uib-accordion-heading>
{{'2101_OrderEntry.Organizer.Service' | translate}}{{service.key}} <br/>
<span>{{'2101_OrderEntry.Organizer.SelectedAgenda' | translate}}</span> {{ orderOrganizerCtrl.getAgendaName(service.key) }} <br/>
<span>{{'2101_OrderEntry.Organizer.DateHourSelected' | translate}}</span> {{ orderOrganizerCtrl.getAppointment(service.key) }}
</uib-accordion-heading>
<!-- Here, datatable content -->
<table class="table data-table row-border hover" id="agenda_{{service.key}}" datatable="ng">
<thead>
<th class="sorting_asc">{{'2101_OrderEntry.Organizer.AgendaServices' | translate}}</th>
<th class="sorting_asc sorting_1">{{'2101_OrderEntry.Organizer.DateAppointment' | translate}}</th>
<th class="sorting_asc">{{'2101_OrderEntry.Organizer.HourAppointment' | translate}}</th>
</thead>
<tbody>
<tr ng-click="orderOrganizerCtrl.selectRow(item, 'agenda_' + service.key, service.key)" ng-repeat="item in orderOrganizerCtrl.agendaSimplified track by $index" ng-if="item.serviceName === service.key">
<td align="center">{{item.agendaName}}</td>
<td align="center">{{item.dateAppointment| date:'dd MM yyyy'}}</td>
<td align="center">{{item.hourAppointment}}</td>
</tr>
</tbody>
</table>
</div>
</uib-accordion>
My problem is the sorting of "dateAppointment" column. Each "item.dateAppointment" element is a Date element. Why sorting is not working? I've tried to use DTColumnDefBuilder with the definition of dtColumnDefs in this way:
this.dtColumnDefs = [
DTColumnDefBuilder.newColumnDef(1).
.withOption('type', 'date')
];
But it is not working (probably because tables are created dinamically). Someone could help me?