WANTING a ListGrid field with ValueMap to be FILTERED as if a ComboBox
In this example, I've modified a showcase example (see below of which one). I have a continent field (integer) that is a foreign key into a Continent table. I use optionDataSource to display the continent name. When filtering as a SelectItem, an exact text match is performed on the display field.
Instead, I would like to filter using the field as a comboBox. I.e, type in the filter field and see hints as to which are valid text values. The user then has a choice to use the exact text value that's suggested in the comboBox actions or just to use a partial match as if one was searching a textItem.
However, when using the attribute:
for the continent field, I get no response from the filter.
HOW would I filter the continent field as if it were a ComboBoxItem?
ENVIRONMENT:
1.smartgwtpower-3.0p downloaded on 09-18-2012
2. MacOSX 10.8.1,
Eclipse Indigo Service Release 2 Build id: 20120216-1857
chrome and eclipse:runOnServer
Tomcat 7.0.27
3,4, and 5 not apropos
MODIFICATIONS TO EXAMPLE in EE Showcase:
Variation of SmartGWT EE Showcase->Java Data Integration -> SQL ->Basic Connector.
1. I imported the world.data.xml into MySQL.
2. I normalized the table by adding a Continent table.
3. I added attribute sortField to the continent field.
4. I added operationId to sort the filter pulldown.
In this example, I've modified a showcase example (see below of which one). I have a continent field (integer) that is a foreign key into a Continent table. I use optionDataSource to display the continent name. When filtering as a SelectItem, an exact text match is performed on the display field.
Instead, I would like to filter using the field as a comboBox. I.e, type in the filter field and see hints as to which are valid text values. The user then has a choice to use the exact text value that's suggested in the comboBox actions or just to use a partial match as if one was searching a textItem.
However, when using the attribute:
Code:
filterEditorType="comboBox"
HOW would I filter the continent field as if it were a ComboBoxItem?
ENVIRONMENT:
1.smartgwtpower-3.0p downloaded on 09-18-2012
2. MacOSX 10.8.1,
Eclipse Indigo Service Release 2 Build id: 20120216-1857
chrome and eclipse:runOnServer
Tomcat 7.0.27
3,4, and 5 not apropos
MODIFICATIONS TO EXAMPLE in EE Showcase:
Variation of SmartGWT EE Showcase->Java Data Integration -> SQL ->Basic Connector.
1. I imported the world.data.xml into MySQL.
2. I normalized the table by adding a Continent table.
3. I added attribute sortField to the continent field.
4. I added operationId to sort the filter pulldown.
Code:
<DataSource ID="worldDS" serverType="sql" tableName="worldDS" > <fields> <field name="pk" type="sequence" hidden="true" primaryKey="true" /> <field name="countryCode" type="text" title="Code" required="true" /> <field name="countryName" type="text" title="Country" required="true" /> <field name="capital" type="text" title="Capital" /> <field name="government" type="text" title="Government" length="500" /> <field name="continent" type="integer" title="Continent" filterEditorType="comboBox" optionDataSource="Continent" optionOperationId="byName" valueField="pk" displayField="name" sortField="name" /> <field name="independence" type="date" title="Nationhood" /> <field name="area" type="float" title="Area (km2)" /> <field name="population" type="integer" title="Population" /> <field name="gdp" type="float" title="GDP ($M)" /> <field name="member_g8" type="boolean" title="G8" /> </fields> </DataSource>
Code:
<DataSource ID="Continent" serverType="sql" tableName="Continent" > <fields> <field name="pk" type="sequence" hidden="true" primaryKey="true" /> <field name="name" type="text" title="Continent" required="true" /> </fields> <operationBindings> <operationBinding operationId="byName" operationType="fetch"> <orderClause> name asc </orderClause> </operationBinding> <operationBinding operationId="byID" operationType="fetch"> <orderClause> pk asc </orderClause> </operationBinding> </operationBindings> </DataSource>
Comment