Ignore:
Timestamp:
Jun 29, 2011, 3:30:24 PM (13 years ago)
Author:
gav
Message:

Add filterpane search to CostCode? list view.

File:
1 edited

Legend:

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

    r633 r953  
    33@Secured(['ROLE_AppAdmin', 'ROLE_Manager'])
    44class CostCodeDetailedController extends BaseController {
    5    
     5
     6    def filterService
     7
    68    def index = { redirect(action:list,params:params) }
    79
     
    1113    def list = {
    1214        params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
    13         [ costCodeInstanceList: CostCode.list( params ), costCodeInstanceTotal: CostCode.count() ]
     15
     16        if(!params.filter) {
     17            return [costCodeInstanceList: CostCode.list(params),
     18                    costCodeInstanceTotal: CostCode.count(),
     19                    filterParams: params]
     20        }
     21
     22        // filterPane:
     23        return[ costCodeInstanceList: filterService.filter( params, CostCode ),
     24                costCodeInstanceTotal: filterService.count( params, CostCode ),
     25                filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params),
     26                params:params ]
    1427    }
    1528
Note: See TracChangeset for help on using the changeset viewer.