Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Caddy on Jul 15, 2008 23:19
open dhtmlx forum
Sorting of Numbers

Hi,

I have a question regarding the sorting of values.

I our database we have "bigger" numbers stored. The issue now is that
I fetch the formatted out of the database.
f.e. dbval : 111222999 -> 111.222.999

This makes value the easier to read for the users.

But : If I click on the column heading, the sorting doesnt work anymore
(because the grid treats it as a string ?? )

Does anybody had also this problem and fixed it ??

Thanks in advance,
Caddy
Answer posted by Support on Jul 16, 2008 02:31
There 3 ways to resolve problem
a) use end|ron column type and setNumberFormat ( pro only )
    http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Cell_values_formating.html#grid_art_formatcells

b) define custom sorting functionality (pro only)
    http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Sorting_in_grid.html#grid_art_sort

c) define custom cell type, which will render cell value as necessary, but return correct sortable value by getValue method
    http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Custom_excell_creation.html#grid_cexc
Answer posted by Carsten on Jul 16, 2008 03:14
Tnks for the quick response !!