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
7 Replies
Does anyone know how to resolve this please?
Solution
Are you casting it as an integer in the model?
yes
hmm. not sure then, but it looks like it's getting cast to a string somewhere.
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.
wonder if it's something to do with the split layout. Integer sorting is working fine for me.
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.