Hi,
when clicking on the grid in the countryCodeField in this standalone repro case, a javascript error occurs. I can't seem to figure out what's going wrong.
The valuemap will be different for other fields, but doesn't work on this field alone.
dev mode
SmartGWT LGPL build 21-09-2010
when clicking on the grid in the countryCodeField in this standalone repro case, a javascript error occurs. I can't seem to figure out what's going wrong.
The valuemap will be different for other fields, but doesn't work on this field alone.
Code:
final Map <String, String> customEnum = new HashMap<String, String>(); customEnum.put("Europe1", "Europe1"); customEnum.put("Europe2", "Europe2"); final ListGrid countryGrid = new ListGrid(); countryGrid.setWidth100(); countryGrid.setHeight100(); countryGrid.setShowAllRecords(true); ListGridField countryCodeField = new ListGridField("countryCode","Code", 40); ComboBoxItem enumSelectItem = new ComboBoxItem(); countryCodeField.setEditorType(enumSelectItem); countryCodeField.setEditorValueMapFunction(new EditorValueMapFunction() { public Map<String, String> getEditorValueMap(Map values, ListGridField field, ListGrid grid) { //Retrieve custom ValueMap (will vary for different ListGridFields) return customEnum; } }); ListGridField nameField = new ListGridField("countryName", "Country"); ListGridField independenceField = new ListGridField("independence","Nationhood", 225); independenceField.setType(ListGridFieldType.DATE); ListGridField populationField = new ListGridField("population","Population"); populationField.setType(ListGridFieldType.INTEGER); ListGridField gdpField = new ListGridField("gdp", "GDP ($B)"); gdpField.setType(ListGridFieldType.FLOAT); countryGrid.setFields(new ListGridField[] { countryCodeField,nameField, independenceField, populationField, gdpField }); countryGrid.setCanResizeFields(true); countryGrid.setData(CountryData.getRecords()); countryGrid.setCanEdit(true); countryGrid.setEditEvent(ListGridEditEvent.CLICK); countryGrid.draw();
dev mode
SmartGWT LGPL build 21-09-2010
Comment