1

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.

garyv
  • 187
  • 1
  • 9
  • Is this happening across browsers or just one in particular? – Miguel-F Sep 14 '12 at 15:17
  • Yes, this happens across all browsers, IE8, Chrome, Safari and Firefox. Note: IE8 on XP, clicking on the header dropdown menu breaks the grid and causes the grid content to disappear. – garyv Sep 14 '12 at 21:01
  • How is the data stored in your database (varchar, int)? – Miguel-F Sep 17 '12 at 12:30
  • Can you check if the getMetadata(query) to check if the column is indeed a number type or converting into a text type ? – Sanjeev Apr 10 '13 at 02:38

0 Answers0