You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JTable does NOT do any sorting, it passes the header clicks to the server with a load request and parameter jtSorting set to a string like "colName ASC/DESC" for the server to perform the sort. In my experience this is usually in the database, so your post is really an SQL question. You may get better answers on a SQL forum.
I use mySQL which has no natural sorting features, but stackoverflow is full of niche solutions, that you might find useful.
Looks like @aradi222 is looking for number sorting for the string values. That can be possible if you manage to have clear logic to segregate numbers from string values (think the data always have the first two characters to be ignored for number sorting, take it from third char till end ex: oracle TO_NUMBER(SUBSTR('1A100', 3)) then use for sorting the entire expression in the order by clause of the database query might help.
I'm looking for the easiest way to sort a Jtable column that consists of numbers and text, and a combination of these.
E.g.
'1B1'
'1A2'
'1A100'
'1A1'
'1A10'
turns into (correct)
'1A1'
'1A2'
'1A10'
'1A100'
'1B1'
Jtable sorts like this: (wrong)
'1A1'
'1A10'
'1A100'
'1A2'
thank you
The text was updated successfully, but these errors were encountered: