Sort Addresses Ascending
Sort Addresses Ascending
PierceMcGeough
Posts: 6Questions: 2Answers: 0
I am looking to see if you can have jquery data-tables columns sorted by alpha ascending and then the numeric ascending afterwards. The following is the way I have it displaying with the general sort alphabetically. This is the code below that I am currently using. They are also links so i know sorting num wont work It will sort the col ascending but like this
1 My Home,
11 My Home,
23 My Home,
4 My Home,
My Home 4,
I am looking to get it like this
1 My Home,
4 My Home,
11 My Home,
23 My Home,
My Home 4,
[code]
var dataTableDefaults = {
"fnDrawCallback" : function () {
},
"aLengthMenu": [
[10, 15, 25, 50, 100, -1],
[10, 15, 25, 50, 100, "All"]
],
"iDisplayLength": 25,
"oLanguage": {
"sLengthMenu": "_MENU_ Records per page",
"sInfo": "_START_ - _END_ of _TOTAL_",
"sInfoEmpty": "0 - 0 of 0",
"oPaginate": {
"sPrevious": "Prev",
"sNext": "Next"
}
},
"aoColumnDefs": [{
'bSortable': false,
'aTargets': [-1]
}],
}
$('#sort_col_3').dataTable($.extend(true, {}, dataTableDefaults, {
'aaSorting': [[2,'asc']]
}));
[/code]
1 My Home,
11 My Home,
23 My Home,
4 My Home,
My Home 4,
I am looking to get it like this
1 My Home,
4 My Home,
11 My Home,
23 My Home,
My Home 4,
[code]
var dataTableDefaults = {
"fnDrawCallback" : function () {
},
"aLengthMenu": [
[10, 15, 25, 50, 100, -1],
[10, 15, 25, 50, 100, "All"]
],
"iDisplayLength": 25,
"oLanguage": {
"sLengthMenu": "_MENU_ Records per page",
"sInfo": "_START_ - _END_ of _TOTAL_",
"sInfoEmpty": "0 - 0 of 0",
"oPaginate": {
"sPrevious": "Prev",
"sNext": "Next"
}
},
"aoColumnDefs": [{
'bSortable': false,
'aTargets': [-1]
}],
}
$('#sort_col_3').dataTable($.extend(true, {}, dataTableDefaults, {
'aaSorting': [[2,'asc']]
}));
[/code]
This discussion has been closed.