i want to sort a CGRIDVIEW Column Natural/Numeric so 1,2,3,4,5… instead of 1,10,11,2…
The Problem is that there is a String then the Number and after that another string. So i need the field to be TEXT. Can i sort for another Column without showing it (so clicking on MyAttribute1 would sort for MyAttribute2?) Or even better can I force Yii to sort Numerically?
As of sorting in yii - I do not recommend it unless there is very small set of data to be sorted. This approach needs to load all records to memory and then sort them in PHP, which is very ineffective…