Fixed emoji sorting in organization list and service list views.
This commit is contained in:
parent
ebff7251e8
commit
a1b0c34645
2 changed files with 78 additions and 14 deletions
|
@ -47,14 +47,47 @@
|
|||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$.fn.dataTable.moment( 'DD/MM/YYYY' );
|
||||
$.fn.dataTable.moment('DD/MM/YYYY');
|
||||
|
||||
$.extend($.fn.dataTable.ext.type.order,
|
||||
{
|
||||
"custom-sort-asc": function(x, y)
|
||||
{
|
||||
if (!(!isNaN(x) || !isNaN(y)))
|
||||
return 0;
|
||||
else if (isNaN(x))
|
||||
return -1;
|
||||
else if (isNaN(y))
|
||||
return +1;
|
||||
else
|
||||
return x-y;
|
||||
},
|
||||
"custom-sort-desc": function(x, y)
|
||||
{
|
||||
if (!(!isNaN(x) || !isNaN(y)))
|
||||
return 0;
|
||||
else if (isNaN(x))
|
||||
return +1;
|
||||
else if (isNaN(y))
|
||||
return -1;
|
||||
else
|
||||
return y-x;
|
||||
}
|
||||
} );
|
||||
|
||||
|
||||
$('#organizations').DataTable(
|
||||
{
|
||||
paging: false,
|
||||
ordering: true,
|
||||
"order": [[ 2, "desc" ]],
|
||||
language: dataTableFrench
|
||||
language: dataTableFrench,
|
||||
"columnDefs":
|
||||
[
|
||||
{ targets: 2, "type": 'custom-sort' },
|
||||
{ targets: 3, "type": 'custom-sort' },
|
||||
{ targets: 4, "type": 'custom-sort' }
|
||||
]
|
||||
});
|
||||
} );
|
||||
</script>
|
||||
|
|
|
@ -136,14 +136,45 @@
|
|||
<script type="text/javascript">
|
||||
$(document).ready(function()
|
||||
{
|
||||
$.fn.dataTable.moment( 'DD/MM/YYYY' );
|
||||
$.fn.dataTable.moment('DD/MM/YYYY');
|
||||
|
||||
$.extend($.fn.dataTable.ext.type.order,
|
||||
{
|
||||
"custom-sort-asc": function(x, y)
|
||||
{
|
||||
if (!(!isNaN(x) || !isNaN(y)))
|
||||
return 0;
|
||||
else if (isNaN(x))
|
||||
return -1;
|
||||
else if (isNaN(y))
|
||||
return +1;
|
||||
else
|
||||
return x-y;
|
||||
},
|
||||
"custom-sort-desc": function(x, y)
|
||||
{
|
||||
if (!(!isNaN(x) || !isNaN(y)))
|
||||
return 0;
|
||||
else if (isNaN(x))
|
||||
return +1;
|
||||
else if (isNaN(y))
|
||||
return -1;
|
||||
else
|
||||
return y-x;
|
||||
}
|
||||
} );
|
||||
|
||||
$('#serviceListTable').DataTable(
|
||||
{
|
||||
paging: false,
|
||||
ordering: true,
|
||||
"order": [[ 2, "desc" ]],
|
||||
language: dataTableFrench
|
||||
language: dataTableFrench,
|
||||
"columnDefs":
|
||||
[
|
||||
{ targets: 4, "type": 'custom-sort' },
|
||||
{ targets: 5, "type": 'custom-sort' }
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue