Incorrect ordering

Hello everybody. Guys, why is this ordering always wrong? The 1040 should come at the end and not at the beginning of the list. This column is of type int. Is there anything I can do to figure out how to fix this or see why this is happening? Remembering that I am using the Filament v2 table Builder in this project. Thanks
No description
Solution:
Are you casting it as an integer in the model?
Jump to solution
7 Replies
joao nivaldo
joao nivaldo4mo ago
Does anyone know how to resolve this please?
Solution
awcodes
awcodes4mo ago
Are you casting it as an integer in the model?
joao nivaldo
joao nivaldo4mo ago
yes
awcodes
awcodes4mo ago
hmm. not sure then, but it looks like it's getting cast to a string somewhere.
joao nivaldo
joao nivaldo4mo ago
I also found this. Is there any way to debug in some way or force the cast in the order method? I saw that it accepts a function, but it seems to me that it is just to choose which column and order to be done in the query.
awcodes
awcodes4mo ago
wonder if it's something to do with the split layout. Integer sorting is working fine for me.
No description
joao nivaldo
joao nivaldo4mo ago
I thought about this, so I put these values in an individual column to test. But the same thing happens both in groups and individually. I think it's treating it for some divine reason as a string and not as an int. I managed to find the error. The values were coming from an API and it was as a string and was not being converted when it went to the Model. I corrected this and it worked fine. Thank you very much.