Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

194
Visualizações
Alphanumeric sorting in Ag grid - Angular

I'm using the Ag grid framework to display data in my Angular project. I'm using Ag grid's default sorting feature for one of the columns that accepts string values and even includes alphanumerics. While sorting that column in ascending order, the values were arranged in the following manner, I'm not sure what logic was used to sort it out. I'd appreciate it if someone could explain things to me.




Ascending order:

{'10','110','120','170','20','30','31','80','A','BPS1'}

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This is not really related specifically to AG Grid, but how strings with numbers are sorted.

You can verify this with the following:

var myNums = ['170','20','30','10','110','120','31','80','A','BPS1'];
myNums.sort();
console.log(myNums)

As you can see, that's the same result as if you sorted these values in the grid.

Now we have that out of the way, back to AG Grid, if you want to sort these values in a different way, you'll have implement a comparator which allows you to have Custom Sorting

There's an example showing how to do this in the documentation here.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda