ctx.model
The FlowModel instance where the current RunJS execution context is located. It serves as the default entry point for scenarios like JSBlock, JSField, and JSAction. The specific type varies depending on the context: it could be a subclass such as BlockModel, ActionModel, or JSEditableFieldModel.
Scenarios
Tip: If you need to access the parent block carrying the current JS (e.g., a Form or Table block), use
ctx.blockModel. To access other models, usectx.getModel(uid).
Type Definition
FlowModel is the base class. At runtime, it is an instance of various subclasses (such as BlockModel, FormBlockModel, TableBlockModel, JSEditableFieldModel, ActionModel, etc.). Available properties and methods depend on the specific type.
Common Properties
Common Methods
Relationship with ctx.blockModel and ctx.getModel
In a JSField, ctx.model is the field model, while ctx.blockModel is the Form or Table block containing that field.
Examples
Updating Block/Action Status
Dispatching Model Events
Using UID for Popup Binding or Cross-Model Access
Related
- ctx.blockModel: The parent block model where the current JS is located.
- ctx.getModel(): Get other models by UID.

