Copy link to clipboard
Copied
Has anyone ever been able to sort times appropriately in a CFGRID? I cannot seem to Google anything that is helpful.
~Clay
We've had a lot of luck with the jQuery Data Tables plug in: http://datatables.net/
It supports a very extensible sorting system: http://datatables.net/release-datatables/examples/basic_init/multi_col_sort.html
It does require a certain familiarity with jQuery. The adobe forum post that I included suggested using a datetime stamp from the database instead of the formatted time string may work in CFGrid.
Copy link to clipboard
Copied
Basically it is sorting them as follows...
9:30
5:00
4:00
10:00
So it seems to be sorting them via digits and not as time should be sorted. Anyone run into this before?
Copy link to clipboard
Copied
I'm not sure that there is a built in way to sort based on time value using CFGrid, but you could always extend the underlying grid system (I think it uses Ext-js) to add a sort mask column that convets the time into an integer (removing the colon ":") and use a sorting function to override the sorting on that field.
Copy link to clipboard
Copied
Also, this:
Copy link to clipboard
Copied
Can you please point me in the right direction? Are there docs anywhere? I have been playing with JQuery and the tablesorter plugin using a custom parser, but running into some difficulties with that.
Copy link to clipboard
Copied
We've had a lot of luck with the jQuery Data Tables plug in: http://datatables.net/
It supports a very extensible sorting system: http://datatables.net/release-datatables/examples/basic_init/multi_col_sort.html
It does require a certain familiarity with jQuery. The adobe forum post that I included suggested using a datetime stamp from the database instead of the formatted time string may work in CFGrid.
Copy link to clipboard
Copied
Thanks...datatables worked great! I had to do a little reformating with some CF, but datatables did the job.