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

CFGRID Sort Time

Explorer ,
Nov 02, 2011 Nov 02, 2011

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

TOPICS
Advanced techniques

Views

1.1K

Translate

Translate

Report

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.

Votes

Translate

Translate
Explorer ,
Nov 03, 2011 Nov 03, 2011

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?

Votes

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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
Documentation