public class GxCellEditorSuggestion
extends GxCellEditorAbstract
A Suggestion/autocomplete cell editor.
The suggestion cell editor is an input which gives the user a list of values (suggestions) to choose from while it types.
The suggestion list can be resolved using a custom object which implements
GxCellEditorSuggestionResolverInterface
or extends GxCellEditorSuggestionResolver
ex:
use ::BBjGridExWidget/GxCellEditors.bbj::GxCellEditorSuggestion editor! = new GxCellEditorSuggestion("ANY_UNIQUE_ID", new CustomResolver()) editor!.setEmptyMessage("No data to display") column! = grid!.getColumn("COLUMN_ID") column!.setCellEditor(editor2!)
Modifier and Type | Field and Description |
---|---|
BBjNumber | AllowCustomValues! When true , then input values which are not part of the suggestion list will be accepted , rejected otherwise |
BBjString | EmptyMessage! The message that will be showed when there are no suggestions that match the entered value. |
BBjNumber | Height! Setup the suggestion list height in pixels |
BBjNumber | MinLength! Specify the minimum length, when autocomplete should appear on the screen. |
BBjString | Pattern! A regular expression that the input's value must match In order for the value to pass constraint validation |
BBjNumber | Required! When true , then the input cannot be empty and a value is required to consider the input valid |
BBjNumber | ShowOnFocus! Displays suggestions on focus of the input element. Note that if true, the |
BBjString | SuggestionGroupTemplate! An HTML template to be used for rendering the suggestion groups ex: template! = " |
BBjString | SuggestionItemTemplate! An HTML template to be used for rendering the suggestion items ex: template! = " |
BBjNumber | SuppressSuggestionOnInvalidInput! When true , then the suggestion will not be triggered for invalid inputs |
BBjString | Title! The input title , when set to null() or "default" then we use the browser's default title , other wise the value defined in this option |
BBjNumber | Width! Setup the suggestion list width in pixels |
Constructor and Description |
---|
GxCellEditorSuggestion(BBjString id!, GxCellEditorSuggestionResolverInterface resolver!) Construct new GxCellEditorSuggestion |
Modifier and Type | Method and Description |
---|---|
JsonObject | getAsJsonObject() @override {@inheritDoc} |
static BBjString | getCellEditorName() @override {@inheritDoc} |
BBjString | getId() Get the editor unique id |
GxCellEditorSuggestionResolverInterface | getResolver() Get the editor resolver instance |
public BBjNumber AllowCustomValues!
When true , then input values which are not part of the suggestion list will be accepted , rejected otherwise
public BBjString EmptyMessage!
The message that will be showed when there are no suggestions that match the entered value.
public BBjNumber Height!
Setup the suggestion list height in pixels
public BBjNumber MinLength!
Specify the minimum length, when autocomplete should appear on the screen.
public BBjString Pattern!
A regular expression that the input's value must match In order for the value to pass constraint validation
public BBjNumber Required!
When true , then the input cannot be empty and a value is required to consider the input valid
public BBjNumber ShowOnFocus!
Displays suggestions on focus of the input element.
Note that if true, the MinLength
option will be ignored and it will
always call the resolver.
public BBjString SuggestionGroupTemplate!
An HTML template to be used for rendering the suggestion groups
ex:
template! = "<%= groupName %>" editor!.setSuggestionItemTemplate(template!)
public BBjString SuggestionItemTemplate!
An HTML template to be used for rendering the suggestion items
ex:
template! = "<%= item.label %> - <%= item.value %> - <%= item.group %>" editor!.setSuggestionItemTemplate(template!)
public BBjNumber SuppressSuggestionOnInvalidInput!
When true , then the suggestion will not be triggered for invalid inputs
public BBjString Title!
The input title , when set to null() or "default" then we use the browser's default title , other wise the value defined in this option
public BBjNumber Width!
Setup the suggestion list width in pixels
public GxCellEditorSuggestion(BBjString id!, GxCellEditorSuggestionResolverInterface resolver!)
Construct new GxCellEditorSuggestion
BBjString
id! A unique id for this editorGxCellEditorSuggestionResolverInterface
resolver! A class which implements `GxCellEditorSuggestionResolverInterface` or extends `GxCellEditorSuggestionResolver` and which can resolver the suggestion list.public JsonObject getAsJsonObject()
@override
{@inheritDoc}
public static BBjString getCellEditorName()
@override
{@inheritDoc}
public BBjString getId()
Get the editor unique id
public GxCellEditorSuggestionResolverInterface getResolver()
Get the editor resolver instance