views:

39

answers:

1

I want to sort the elements in my list and have the option of filter them the same way MS Excel does.

So it should be able to keep the filtered elements in the table and apply a filter within those results as well. Also be able to sort them without refreshing the whole table.

Any help is greatly appreciated!

FG

A: 

you can do it with a criteria in you list action of your controller

def result

if ( params?.filter && params?.filterVal) {
    result = Book.createCriteria().list(max: params?.max, offset: params?.offset) {
         eq(params?.filter,params?.filterVal)
    }
} else {
    // normal list retrieval code
}

where params?.filter is the property to filter on and params?.filterVal is the value

Aaron Saunders
and it'll save other (old) filters?
fgualda87
@fgualda87 can't really answer that question based on the fact there is no code here? I have no idea how you have implemented anything. I am just suggesting how you can code a controller action to respond to a filter based on a property and a value
Aaron Saunders