cfgrid - how to sort a column of numbers numerically

475 Views Asked by At

I'm using a cfgrid control on Coldfusion 9.01 to display a query recordset with several columns of numbers.

My grid is format="html" and a query as the datasource.

A partial list of my grid columns are as follows:

<cfgridcolumn name="delivery" header="Email Delivery" width="300" />
<cfgridcolumn name="deliveryDate" header="Delivery Date" width="100" />
<cfgridcolumn name="sent" header="Sent" width="50" type="numeric"  />
<cfgridcolumn name="Opens" header="Opens" width="50" type="numeric"/>
<cfgridcolumn name="OpenRatio" header="%Opens" width="75" type="numeric"  />

The problem I am running into is that when I click on the column heading to sort one of the number columns, the grid is sorting the numbers as text.

9999, 9, 888, 8, 777, 7 etc.

I have the type set as numeric. Is there there anything else I can do to force the grid to sort the columns of numbers in numerically.

UPDATE: As a workaround, I am using bind as the datasource instead of query and the sorting works as expected.

0

There are 0 best solutions below