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

Changing order of output records

Explorer ,
Nov 03, 2010 Nov 03, 2010

I would like an easy way to change the order of items when I output them from a query.

Can anyone please tell me the best way to go about it?

I would like arrows pointing up or down next to each item. When each arrow is clicked, the page refreshes and the record moves up or down the recordset.

Can anyone please help?

Thankyou

505
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
Engaged ,
Nov 03, 2010 Nov 03, 2010

Sounds like you want a nice UI to sort things. You can do it with CF, by

passing a paramater to your query in its Order By clause, or use can use

something like jquery javascript to do the sorting on the browser level.

http://trirand.com/blog/jqgrid/jqgrid.html

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
Contributor ,
Nov 03, 2010 Nov 03, 2010

Easiest way is to output the table and then use jQuery and the DataTables

plugin to add sorting.

http://jquery.com/

http://datatables.net/

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
Engaged ,
Nov 03, 2010 Nov 03, 2010

You could also use the <cfgrid> tag.  This is probably the easiest way but might not be the best way.  You will be limited on the look and feel of the table that is produced.

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
Engaged ,
Nov 03, 2010 Nov 03, 2010
LATEST

I have never had good luck with cfgrid.

I would look at jquery and the like for a modern, usable solution.

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