Ignore:
Timestamp:
Jun 8, 2010, 4:28:09 PM (15 years ago)
Author:
gav
Message:

New defaultSort for Tasks, sort by status then priority then target start date.
Small improvement to custom:sortableColumnWithImg to allow imgTitle to be specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/TaskDetailedController.groovy

    r567 r582  
    7878        // Remember sort if supplied, otherwise try to restore.
    7979        if(params.sort && params.order) {
    80              session.taskSearchSort = params.sort
    81              session.taskSearchOrder = params.order
     80            // Reset to defaultSort if requested.
     81            if(params.sort == 'defaultSort') {
     82                params.sort = null
     83                params.order = null
     84                session.removeAttribute("taskSearchSort")
     85                session.removeAttribute("taskSearchOrder")
     86            }
     87            else {
     88                session.taskSearchSort = params.sort
     89                session.taskSearchOrder = params.order
     90            }
    8291        }
    8392        else if(session.taskSearchSort && session.taskSearchOrder) {
     
    8897        if(isFilterApplied) {
    8998            // filterPane:
     99            params.sort = params.sort ?: "id"
     100            params.order = params.order ?: "desc"
    90101            if(params.sort == "attentionFlag") // See ticket #64 in Trac.
    91102                params.sort = "id"
     
    146157        filterParams.max = params.max
    147158        filterParams.offset = params.offset?.toInteger() ?: 0
    148         filterParams.sort = params.sort ?: "attentionFlag"
     159        filterParams.sort = params.sort ?: "id"
    149160        filterParams.order = params.order ?: "desc"
    150161
Note: See TracChangeset for help on using the changeset viewer.