I have a ListGrid with a Filter row:
The ListGrid has a column:
The Issue: The Filter header box search appears to act upon the underlying cell values, not the displayed format.
Example: If the cells have the following values:
10302
3098
The applied number format will display these values as
010302
003098
However, a Filter search of "03" will return "010302" but not "003098" (because it's unformatted value is "3098" which does not contain "03").
I'm guessing the issue would be addressed as described in the Javadoc for ListGrid.setShowFilterEditor? There is some sample code
but I get lost at isc.AddProperties (that is not available in SGWT, is it?)
Any guidance appreciated, thanks.
SmartClient Version: v8.2p_2013-01-14/PowerEdition Deployment (built 2013-01-14)
Code:
... listGrid.setShowFilterEditor(true); listGrid.setFilterOnKeypress(true); listGrid.setDataSource(ds_Employee); listGrid.setAutoFetchData(true); ...
Code:
ListGridField lgf_EmployeeId = new ListGridField("EMPLOYEE_ID", "Employee ID", 80); lgf_EmployeeId.setType(ListGridFieldType.INTEGER); lgf_EmployeeId.setCellFormatter(new CellFormatter() { @Override public String format(Object value, ListGridRecord record, int rowNum, int colNum) { // If there's no value to format, exit. if (value == null) { return null; } // Feed the value into the formatter & return it try { NumberFormat nf = NumberFormat.getFormat("000000"); return nf.format(((Number) value).doubleValue()); } catch (Exception e) { // If validation is correct, this should never happen. return value.toString(); } } });
Example: If the cells have the following values:
10302
3098
The applied number format will display these values as
010302
003098
However, a Filter search of "03" will return "010302" but not "003098" (because it's unformatted value is "3098" which does not contain "03").
I'm guessing the issue would be addressed as described in the Javadoc for ListGrid.setShowFilterEditor? There is some sample code
Code:
var newCriteria = myListGrid.getFilterEditorCriteria(); isc.addProperties(newCriteria, { field1:"new value1", field2:"new value2" }); myListGrid.setCriteria(newCriteria);
Any guidance appreciated, thanks.
SmartClient Version: v8.2p_2013-01-14/PowerEdition Deployment (built 2013-01-14)
Comment