#18

Solved

sorting of table by column works oddly

Reported by Jeff Hoffman on Ajax Scaffold · 01/05/2006 02:50:37

Assigned to:
Nobody
Priority:
Normal
Status:
Solved
Category:
None
Version:
3.1.2

I noticed that if I click on a different column header, the “asc” or “desc” is always toggled. I think this is odd, as I would expect clicking a new column header to sort in the default direction, and only toggle if I click the same column that was already sorting the list. The fix is in ajax_scaffold.rb, in Helper.column_sort_direction:

def column_sort_direction(column_name, params)
  1. puts “column_sort_direction column=#{column_name}, prev=#{session[params[:scaffold_id]][:sort]}”
    if column_name && column_name == current_sort(params)
    current_sort_direction(params) == “asc” ? “desc” : “asc”
    else
    “asc”
    end
  2. puts “result=#{result}”
    end

Attachments Upload

No attachment has been uploaded, yet.


Loading comments...