SmartGWT version: Latest
Broswer: Google Chrome
I have a ListGridEditorCustomizer where one field returns a button, Like so:
grid.setEditorCustomizer(new ListGridEditorCustomizer() {
ButtonItem button;
@Override
public FormItem getEditor(ListGridEditorContext context)
{
ListGridField field = context.getEditField();
if (field.getName().equals(sendField.getName()))
{
DynamicForm form = (DynamicForm) grid.getParentElement().getParentElement();
if (button == null)
{
button = new ButtonItem("Send");
}
if (form.getEntityId() == null)
{
button.disable();
button.setTooltip("Cannot send approval email on a new form.");
}
else
{
button.enable();
button.setTooltip("Manually send approval email.");
}
return button;
}
// Defaults to standard editor type based on DSF type
return null;
}
});
However, what I want is, instead of enabling/disabling the button, I’d rather hide the whole ListGridField, however, when it try to hide/show it via sendField.setHidden(true), it will hide the field, but the button remains. I’ve tried invalidating the cache and grid.refreshFields(), but neither one worked. Anyone know a way around this?