Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda