Hi mf,
IMHO: If it works, it works. If key/value is enough for you, this should be fine.
Otherwise, if your data is static, you could also use a clientOnly DataSource.
Best regards
Blama
Announcement
Collapse
No announcement yet.
X
-
Hi Blama,
ok that works, thank you.
Is it necessary (or better) for this solution that I change my SelectItem to get it's data via fetch-service (setOptionDataSource) instead of using setValueMap?
Leave a comment:
-
Hi @mf,
please try this:
Code:ListGridField shortnameLGF = new ListGridField(shortnameField); shortnameLGF.setCellFormatter(new CellFormatter() { @Override public String format(Object value, ListGridRecord record, int rowNum, int colNum) { if (value != null) if (record.getAttribute(nameField) == null || value.equals(record.getAttribute(nameField))) return value.toString(); else return record.getAttribute(nameField) + " (" + value.toString() + ")"; else return null; } }); [B]shortnameLGF.setHoverCustomizer(new HoverCustomizer() { @Override public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) { String description = record.getAttribute(descriptionField); if (description == null) description = i18n.noDescriptionGiven(); return description; } }); shortnameLGF.setShowHover(true);[/B] setPickListFields(shortnameLGF);
Blama
Leave a comment:
-
-
Hi mf,
see setItemHoverFormatter().
My code is:
Code:setItemHoverFormatter(new FormItemHoverFormatter() { @Override public String getHoverHTML(FormItem item, DynamicForm form) { if (item.getSelectedRecord() == null || item.getSelectedRecord().getAttribute(nameField) == null) return null; String retVal = "<b>" + item.getSelectedRecord().getAttribute(nameField) + "</b><br/><br/>"; String description = item.getSelectedRecord().getAttribute(descriptionField); if (description == null) return retVal + i18n.noDescriptionGiven(); else return retVal + description; } });
Blama
Leave a comment:
-
Tooltip in Selectitem
Hi,
we use a SelectItem which we fill it with setValueMap.
I need to show a tooltip when the mouse hovers over the items in the SelectItem (I mean before selecting an entry from the selectitem).
How can we do this?
(we are using smartgwt-5.0-2015-08-20) with IE-11).Last edited by mf; 24 Oct 2016, 01:25.Tags: None
Leave a comment: