More advanced list ordering

Hi,

the thing is - I want to sort alphanumeric strings in list view , but since my element is varchar, Fabrik doesn't orders numbers correctly. So instead of test1, test2, test3, test10, I get test1, test10, test2, test3. There are a few ways of correcting it in pure MySQL (ie. with a help of CAST), but how can I play with this more advanced ordering in case of Fabrik lists? Where can I determine such ordering?

Cheers,

Olek
 
Perhaps a tad complicated, but one way I can think of:
- In phpMyAdmin, create a MySQL view where you cast the column the way you need it.
- In Fabrik, create a new list, point it to the view, and use this for display.
- Leave the original list intact and keep using its form (because the view is "read only", of course), only use a form redirect plugin to load the new list on save.

EDIT:
If you want to edit rows from the list, sure, you'll need custom edit URLs.
Similar with the "add" button: you'll need to replace it with a custom button or link, e.g. in the list intro.
 
Another not perfect solution either would be to create a hidden calc element for ordering where you "cast" eg. test1 to test001, test10 to test010 etc.
 
Another not perfect solution either would be to create a hidden calc element for ordering where you "cast" eg. test1 to test001, test10 to test010 etc.
This would be my recommended solution. Much easier than an sql view.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top