Hello,
I have a ListGrid which is filled with ListGridRecords. The ListGridRecords are of a special type:
The RecordContainer class contains data objects like the following:
I am displaying the Employee data in a ListGrid which works fine. But if I enter a filter value in my ListGrid and press enter, nothing happens. This isn't surprising at all since the filter does not understand the data objects. How can I use filtering with custom data objects?
I managed to enable sorting this way:
Maybe something similar exists for filtering?
I have a ListGrid which is filled with ListGridRecords. The ListGridRecords are of a special type:
Code:
public class RecordContainer<T> extends ListGridRecord
{
private T data;
}
Code:
public class Employee {
String name;
String password;
int age;
}
I managed to enable sorting this way:
Code:
nameField.setSortNormalizer( new SortNormalizer() {
@Override
public Object normalize( ListGridRecord record, String fieldName )
{
RecordContainer<Employee> employeeRecord = (RecordContainer<Employee>) record;
Employee employee = employeeRecord.getData();
return employee .getName();
}
});
Comment