@serenity-is/sleekgrid / EditorLock
Class: EditorLock
Defined in: src/core/editing.ts:210
Locking helper that ensures only a single EditController is active at a time. Prevents concurrent edits and validation races; the grid queries this before navigating, sorting, or scrolling while an edit is open.
Constructors
Constructor
new EditorLock():
EditorLock
Returns
EditorLock
Methods
activate()
activate(
editController):void
Defined in: src/core/editing.ts:228
Acquires the edit lock for the given controller. Throws if another controller already holds the lock or if the controller does not implement the required methods.
Parameters
editController
Controller acquiring the lock.
Returns
void
cancelCurrentEdit()
cancelCurrentEdit():
boolean
Defined in: src/core/editing.ts:268
Attempts to cancel the current edit via the active controller.
Returns
boolean
true if cancelled (or no edit was active).
commitCurrentEdit()
commitCurrentEdit():
boolean
Defined in: src/core/editing.ts:260
Attempts to commit the current edit via the active controller.
Returns
boolean
true if committed (or no edit was active), false if validation failed.
deactivate()
deactivate(
editController):void
Defined in: src/core/editing.ts:249
Releases the edit lock held by the given controller. Throws if the controller is not the currently active one.
Parameters
editController
Controller releasing the lock.
Returns
void
isActive()
isActive(
editController?):boolean
Defined in: src/core/editing.ts:218
Checks whether an edit controller currently holds the edit lock.
Parameters
editController?
Controller to test; when omitted, returns true if any controller is active.
Returns
boolean
Whether the given (or any) controller is active.