Grid: select box of filter not sorted as int?

Hi everyone,





I have a problem with the sorting of the filters select box.



My field is formatted as “int”/“ro” (displaying calendar weeks). This works fine (2, 5, 17, …).

But the content of the filter select box is then sorted as a string (17, 2, 5, …).



Any idea? Or am I missing a simple switch some place?





Cheers,

Dom :slight_smile:


Unfortunately there is no way to switch sorting for filtering select boxes. Currently options always sorted as string.



You can modify source code in next way




dhtmlxgrid_filter.js, line 185
          return f.sort();




can be replaced wth 
          return f.sort(function(a,b){
                    return (parseFloat(a)>parseFloat(b))?1:-1;
          })



But it will change sorting order for all filters