Anthony Kam asked 1 year ago


I have a list of course numbers to sort: 1, 12, 13, 13L, 1L, 2,3,4,5,6,8 (see screenshot)

The correct sort order is : 1, 1L, 12,13, 13L, 2,3,4,…

How can I do this? any ideas?


1 Answers
Abu Ghufran Staff answered 1 year ago

If using mysql, You can try setting for that column (e.g. course_number). This way it will remove all characters and only use numeric while sorting.

$col["sortname"] = "CAST(course_number AS UNSIGNED)";
Abu Ghufran - Dev Team
Grid 4 PHP Framework
Your Answer

4 + 11 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.

How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?