Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!