Field
Abstract
Base class for TextField and NumberField. Not to be used directly.
Most subclasses can be used as editors for the Column. The most popular are:
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Specify
trueto auto select field contents on focus -
Specify
trueto highlight field after external value changes -
Text to display in empty field.
Has a corresponding runtime placeholder property.
-
Configure as
trueto indicate that anullfield value is to be marked as invalid. This will optionally append a * to the field label if showRequiredIndicator is set.Has a corresponding runtime required property.
-
trueto automatically display a * after the label for this field when it is required.Has a corresponding runtime showRequiredIndicator property.
-
Set to
true, completely bypasses validation logic (could be userful if your field is noteditableto the user). -
Default value
Has a corresponding runtime value property.
-
The default configuration for the container.
-
A list of property names to be set in the underlying input element from properties by the same name in this Field object if the value is not
== null. -
Sets the native
autocompleteproperty of the underlying input element. For more information, please refer to MDN -
Text alignment for the input field.
-
inputAttributes : Object<String, String>
Sets custom attributes of the underlying input element. For more information, please refer to MDN
-
If you need to use something else than a default
inputelement, as the input element, provide the tag name here. Please note that this is used for advanced usage only, for example when using WebComponents (custom elements), and that the configured element must fulfil the same contract as a regular input element. -
Sets the
typeattribute of the underlying input element (password, hidden, date, color, etc.). -
The width to apply to the
.b-field-innerelement, which encompasses theinputelement and any triggers. If a number is specified,pxwill be used. -
Sets the native
spellcheckproperty of the underlying input element. For more information, please refer to MDN -
Set to
falseto not highlight a field as invalid while typing, to instead show it on ENTER key press or similar. -
The labels to add either before or after the input field. Each label may have the following properties:
htmlThe label text.align'start'or'end'which end of the field the label should go.
- html : String
Label text
- align : 'start'/'end'
Which end of the file the label should go
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of Field class, or subclass thereof.
-
The input element at the heart if this field
-
Returns true if the field's input is empty
-
Returns true if the field value is valid
-
Text to display in empty field.
Has a corresponding placeholder config.
-
Configure as
trueto indicate that anullfield value is to be marked as invalid. This will optionally append a * to the field label if showRequiredIndicator is set.Has a corresponding required config.
-
trueto automatically display a * after the label for this field when it is required.Has a corresponding showRequiredIndicator config.
-
Returns the DOM
ValidityStatefor this widget's input element, ornullif there isn't one. -
Identifies an object as an instance of Field class, or subclass thereof.
Functions
Functions are methods available for calling on the class-
Clears the value of this Field, and triggers the clear event.
-
internalOnChange( )private
Trigger event when fields input changes
Triggers: change
-
onDisabled( )private
Called when disabled state is changed. Used to add or remove 'b-invalid' class for the invalid field based on current disabled state.
-
onEditComplete( )internal
Template function which may be implemented by subclasses to synchronize input state and validity state upon completion of the edit.