Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFGRID Sort Time

Explorer ,
Nov 02, 2011 Nov 02, 2011

Has anyone ever been able to sort times appropriately in a CFGRID? I cannot seem to Google anything that is helpful.

~Clay

TOPICS
Advanced techniques
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Nov 03, 2011 Nov 03, 2011

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.

Translate
Explorer ,
Nov 03, 2011 Nov 03, 2011

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 03, 2011 Nov 03, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 03, 2011 Nov 03, 2011
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 03, 2011 Nov 03, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Nov 03, 2011 Nov 03, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2011 Nov 04, 2011
LATEST

Thanks...datatables worked great! I had to do a little reformating with some CF, but datatables did the job.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources