Hi Isomorphic,
for each element from "valueMap", filter doesn't work.
When I in filter enter a "key" from the valueMap (in this case "Costas Hummingbird", then it works) but filter should be on "value" from the valueMap(in this case "First Member"))
When I use "setFilterEditorProperties(new ComboBoxItem())" then it works as expected. (using 6.1p/v11.1p_2018-03-15).
Can you help me with this?
Best regards
Pavo
for each element from "valueMap", filter doesn't work.
When I in filter enter a "key" from the valueMap (in this case "Costas Hummingbird", then it works) but filter should be on "value" from the valueMap(in this case "First Member"))
When I use "setFilterEditorProperties(new ComboBoxItem())" then it works as expected. (using 6.1p/v11.1p_2018-03-15).
Can you help me with this?
Code:
package com.smartgwt.sample.client; import java.util.LinkedHashMap; import java.util.Map; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.Version; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.fields.ComboBoxItem; import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; public class BuiltInDS extends VLayout implements EntryPoint { private IButton recreateBtn; public void onModuleLoad() { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new PageKeyHandler() { public void execute(String keyName) { SC.showConsole(); } }); setWidth100(); setHeight100(); recreateBtn = new IButton("Recreate"); recreateBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { new MyWindow().show(); } }); addMember(recreateBtn); new MyWindow().show(); draw(); } private class MyWindow extends Window { public MyWindow() { setWidth(400); setHeight(400); setMembersMargin(0); setModalMaskOpacity(70); setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")"); SC.logWarn((" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")")); setTitle("ComboBox filter issue"); setShowMinimizeButton(false); setIsModal(true); setShowModalMask(true); centerInPage(); ListGrid listGrid = new ListGrid() { { setShowFilterEditor(true); setFilterOnKeypress(true); setCanEdit(true); setDataSource(DataSource.get("animals")); final Map<Object, String> valueMap = new LinkedHashMap<Object, String>(); valueMap.put("Costas Hummingbird", "First Member"); valueMap.put("Freshwater Stingray", "Second Member"); ListGridField commonNameLGF = new ListGridField("commonName"); commonNameLGF.setValueMap(valueMap); commonNameLGF.setEditorProperties(new ComboBoxItem() { { setAddUnknownValues(false); setValueMap(valueMap); } }); commonNameLGF.setFilterEditorProperties(new TextItem()); setFields(commonNameLGF); fetchData(); } }; addItem(listGrid); } } }
Best regards
Pavo
Comment