How can i sort date column in yadcf datatable?
How can i sort date column in yadcf datatable?
mrcherie
Posts: 2Questions: 1Answers: 0
Hello, i have a problem. I hope you can help me.
I have a yadcf datatable which include date column. I can filter by date but i can not sort by date. Some of my codes is below.
<script>
$(document).ready(function(){
$('#example').dataTable().yadcf([
{column_number : 1, filter_type: "range_date", date_format: "dd.mm.yyyy", filter_default_label: ['ilk', 'son'], type: "date-eu"},
{column_number : 2, filter_type: "date", date_format: "dd.mm.yyyy", filter_default_label: ['Tarih Seç']},
{column_number : 3, filter_type: "auto_complete", filter_reset_button_text: ['Temizle']}
]);
});
</script>
and my tables code is below
<body id="yadcf_example">
<div id="container">
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
<thead>
<tr>
<th>Order Date</th>
<th>Out Date</th>
<th>Customer</th>
</tr>
</thead>
<tbody>
<tr class="odd gradeX">
<td>01.10.2015</td>
<td>05.10.2015</td>
<td>John</td>
</tr>
<tr class="odd gradeX">
<td>02.11.2015</td>
<td>05.11.2015</td>
<td>David</td>
</tr>
<tr class="odd gradeX">
<td>30.01.2015</td>
<td>15.02.2015</td>
<td>Sue</td>
</tr>
<tr class="odd gradeX">
<td>09.12.2015</td>
<td>15.12.2015</td>
<td>Mark</td>
</tr>
</tbody>
</table>
</div>
</body>
This discussion has been closed.
Answers
What I would suggest, is using the
html5_data
option, then add adata-search=""
option with the EPOCH date as the value, then that would have DataTables and YADCFFrom the yadcf .js file comments:
Im pretty sure the
data-filter
handles the sorting as well. But @daniel_r would be able to answer that for sureI think he got his answer on github already
yes, got it, thanks