I want to use an integer column in my ListGrid. This column should filter on keypress and allow filter expressions. This works fine for most of the expressions, but entering a number range (i.e. "100...150") will not work.
Steps to reproduce:
* run example code
* Click into filter of the number column
* Enter "100...120"
Expected behavior:
* Text "100...120" is shown in filter input field
Experienced behavior:
* Text "100120" is shown in filter input field
However if you copy and paste "100...120" into the field everything works fine. Entering "a100...120" and removing the "a" afterwards will also work.
Do you have any idea how to solve or work around this issue?
* SmartClient Version: v10.0p_2014-11-30/LGPL Development Only (built 2014-11-30)
* Tested on Firefox 31.0 Windows 7 Professional
Thanks in advance!
Steps to reproduce:
* run example code
* Click into filter of the number column
* Enter "100...120"
Expected behavior:
* Text "100...120" is shown in filter input field
Experienced behavior:
* Text "100120" is shown in filter input field
However if you copy and paste "100...120" into the field everything works fine. Entering "a100...120" and removing the "a" afterwards will also work.
Do you have any idea how to solve or work around this issue?
Code:
public class Tryout implements EntryPoint { @Override public void onModuleLoad() { // create a number field as primary key final DataSourceField numberDataSourceField = new DataSourceField("number", FieldType.INTEGER); numberDataSourceField.setPrimaryKey(true); // create Record final ListGridRecord record1 = new ListGridRecord(); record1.setAttribute(numberDataSourceField.getName(), 100); // create Record final ListGridRecord record2 = new ListGridRecord(); record2.setAttribute(numberDataSourceField.getName(), 150); // create Data Source using the number field and the two records final DataSource dataSource = new DataSource(); dataSource.setFields(numberDataSourceField); dataSource.setClientOnly(true); dataSource.setCacheData(new ListGridRecord[] {record1, record2}); // create a grid using the datasource (filterable) final ListGrid listGrid = new ListGrid(); listGrid.setDataSource(dataSource); listGrid.setAutoFetchData(true); listGrid.setShowFilterEditor(true); // this combination produces the unwanted behavior listGrid.setFilterOnKeypress(true); listGrid.setAllowFilterExpressions(true); // show grid listGrid.setWidth(200); listGrid.setHeight(200); listGrid.show(); } }
* Tested on Firefox 31.0 Windows 7 Professional
Thanks in advance!
Comment