@serenity-is/sleekgrid / FloatCellEdit
Class: FloatCellEdit
Defined in: src/editors/editors.tsx:148
Float/decimal editor extending TextCellEdit. Supports fixed decimal
places via column.editorFixedDecimalPlaces or FloatCellEdit.DefaultDecimalPlaces.
Extends
Constructors
Constructor
new FloatCellEdit(
args):FloatCellEdit
Defined in: src/editors/editors.tsx:13
Parameters
args
Returns
FloatCellEdit
Inherited from
Properties
_args
protected_args:EditorOptions
Defined in: src/editors/editors.tsx:11
Inherited from
_defaultValue
protected_defaultValue:any
Defined in: src/editors/editors.tsx:10
Inherited from
_input
_input:
HTMLInputElement
Defined in: src/editors/editors.tsx:110
Inherited from
AllowEmptyValue
staticAllowEmptyValue:boolean=false
Defined in: src/editors/editors.tsx:151
When true, empty input serializes to empty string rather than 0.
DefaultDecimalPlaces
staticDefaultDecimalPlaces:number=null
Defined in: src/editors/editors.tsx:153
Default number of fixed decimal places when the column does not specify editorFixedDecimalPlaces. null means no rounding.
Methods
applyValue()
applyValue(
item,state):void
Defined in: src/editors/editors.tsx:73
Writes the serialized value back to the data item's field.
Parameters
item
any
Row data item to mutate.
state
any
Value returned by BaseCellEdit.serializeValue.
Returns
void
Inherited from
destroy()
destroy():
void
Defined in: src/editors/editors.tsx:22
Removes the editor input from the DOM.
Returns
void
Inherited from
focus()
focus():
void
Defined in: src/editors/editors.tsx:27
Focuses the editor's input element.
Returns
void
Inherited from
getDecimalPlaces()
getDecimalPlaces():
number
Defined in: src/editors/editors.tsx:159
Resolves the number of fixed decimal places to use.
Returns
number
Number of places, or null when none is configured.
getValue()
getValue():
string
Defined in: src/editors/editors.tsx:35
Reads the current input value as a string.
Returns
string
Raw string value from the input.
Inherited from
init()
init():
void
Defined in: src/editors/editors.tsx:112
Creates and attaches the editor DOM; called by the constructor.
Returns
void
Inherited from
isValueChanged()
isValueChanged():
boolean
Defined in: src/editors/editors.tsx:81
Tests whether the editor content differs from the loaded default.
Returns
boolean
true if the value has changed.
Inherited from
loadValue()
loadValue(
item):void
Defined in: src/editors/editors.tsx:168
Loads the item's field value into the editor and selects it.
Parameters
item
any
Row data item whose field is being edited.
Returns
void
Overrides
serializeValue()
serializeValue():
any
Defined in: src/editors/editors.tsx:183
Serializes the current input value for commit.
Returns
any
String content of the input.
Overrides
setValue()
setValue(
val):void
Defined in: src/editors/editors.tsx:43
Writes a string value into the input.
Parameters
val
string
Value to set; null/undefined becomes empty string.
Returns
void
Inherited from
validate()
validate():
ValidationResult
Defined in: src/editors/editors.tsx:202
Validates the current value using the column's validator, if any.
Returns
Validation result; always valid when no validator is configured.