I do not know if it is possible with common methods of ordering, because of the natural ordering of the elements.
If you do a test, such as:
var lista = ['1', '4', 'C', '6', '2', 'A'];
function OrdenarArray(a, b) {
return a > b;
}
will have a result: ['1', '2', '4', '6', 'A', ...]
I ordered with a certain effort:
var lista = ['10', '4', 'C', '6', '2', 'A'];
function OrdenarArray(a, b) {
return a > b;
}
var lLetras = new Array();
var lNumeros = new Array();
$.each(lista, function(indice, obj) {
if (!isNaN(parseInt(obj, 0)))
lNumeros.push(Number(obj));
else
lLetras.push(obj);
});
lLetras = lLetras.sort(OrdenarArray);
lNumeros = lNumeros.sort(OrdenarArray);
lista = lLetras;
$.each(lNumeros, function(indice, obj) {
lista.push(obj.toString());
});
Final result: ['A', 'C', '2', '4', ...]
Of course there must be better ways to order. Oh, and I used jquery. = x