【发布时间】:2015-09-25 01:27:58
【问题描述】:
我想对数据表上的日期进行排序。我希望它以D-M-Y 的这种格式进行,但它不起作用。
当我将格式更改为 Y-M-D 时,它可以工作。但我需要这种格式D-M-Y。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#est').dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": '<?php echo base_url(); ?>index.php/welcome/tendersdatatable',
"aaSorting": [
[3, "desc"]
],
"bJQueryUI": true,
"sPaginationType": "bootstrap",
"iDisplayStart ": 20,
"oLanguage": {},
"fnInitComplete": function () {
//oTable.fnAdjustColumnSizing();
},
'fnServerData': function (sSource, aoData, fnCallback) {
$.ajax({
'dataType': 'json',
'type': 'POST',
'url': sSource,
'data': aoData,
'success': fnCallback
});
}
});
$('.dataTables_filter input').addClass('form-control').attr('placeholder', 'Search...').css('margin-right', "4%");
$('.dataTables_length select').addClass('form-control');
});
</script>
【问题讨论】:
标签: javascript jquery ajax date datatables