0
Well I have an array of objects and I need to sort it by name. My array to follow:
COD_IDENT_PESSO: "120151202162147"
FLG_IDENT_PRESE: "M"
FLG_STATU_PESSO: "A"
TXT_NOMEX_PESSO: "Renan Rodrigues Moraes"
COD_IDENT_PESSO: "120151202162542"
FLG_IDENT_PRESE: "L"
FLG_STATU_PESSO: "A"
TXT_NOMEX_PESSO: "Pedro Algusto"
COD_IDENT_PESSO: "120151202162836"
FLG_IDENT_PRESE: "M"
FLG_STATU_PESSO: "A"
TXT_NOMEX_PESSO: "Andre Medeiros"
COD_IDENT_PESSO: "120151202162837"
FLG_IDENT_PRESE: "M"
FLG_STATU_PESSO: "A"
TXT_NOMEX_PESSO: "Sousa Carvalho"
COD_IDENT_PESSO: "1151206095050177"
FLG_IDENT_PRESE: "L"
FLG_STATU_PESSO: "A"
TXT_NOMEX_PESSO: "Membro Sinc"
COD_IDENT_PESSO: "1151209082951928"
FLG_IDENT_PRESE: "M"
FLG_STATU_PESSO: "A"
TXT_NOMEX_PESSO: "55555"
My code responsible for ordering:
for(var i = 0; i < arrayVelho.length; i++){
if(arrayVelho[i].TXT_NOMEX_PESSO < nome){
nome = arrayVelho[i].TXT_NOMEX_PESSO;
arrayNovo = arrayVelho[i];
arrayVelho[i].pop();
}
}
But this logic that I used is not working, how to do ?
Here you can help, just adapt. http://answall.com/questions/100068/sort
– Marconi
Here’s another answer too. http://answall.com/questions/46600/howto sort and sort
– Marconi
Staff thank you very much, for me had different logic, but gave straight with what I wanted.
– Renan Rodrigues
Found an answer to your question?
– durtto
Yes thank you very much
– Renan Rodrigues