Hello
I am using LGP SmartGWT 2.3 build (2010-12-9)
My model is :
Employee{
String employeeId;
String employeeName;
Department department;
}
Department {
String departmentCode;
String departmentName;
}
I have 2 datasource Employee and Department
I have a ListGrid of employee records,
I am displaying the department column in a ListGrid using the
CellFormater, GroupTitleRenderer, GroupValueFunction which works fine.
I create SelectItem for department column filter.
But if I filter value in my ListGrid for department column and press enter, nothing happens. This isn't surprising at all since the filter does not understand the department object.
How can I use filtering with custom data objects?
I managed to enable sorting this way:
Maybe something similar exists for filtering?
I am using LGP SmartGWT 2.3 build (2010-12-9)
My model is :
Employee{
String employeeId;
String employeeName;
Department department;
}
Department {
String departmentCode;
String departmentName;
}
I have 2 datasource Employee and Department
I have a ListGrid of employee records,
I am displaying the department column in a ListGrid using the
CellFormater, GroupTitleRenderer, GroupValueFunction which works fine.
I create SelectItem for department column filter.
But if I filter value in my ListGrid for department column and press enter, nothing happens. This isn't surprising at all since the filter does not understand the department object.
How can I use filtering with custom data objects?
I managed to enable sorting this way:
Code:
departmentField.setSortNormalizer( new SortNormalizer() { @Override public Object normalize( ListGridRecord record, String fieldName ) { JavaScriptObject department = record.getAttributeAsJavaScriptObject("department"); return JSOHelper.getAttribute(department,"name"); } });
Maybe something similar exists for filtering?