logologo
Get Started
Guide
Development
Plugins
API
Home
English
简体中文
日本語
한국어
Español
Português
Deutsch
Français
Русский
Italiano
Türkçe
Українська
Tiếng Việt
Bahasa Indonesia
ไทย
Polski
Nederlands
Čeština
العربية
עברית
हिन्दी
Svenska
Get Started
Guide
Development
Plugins
API
Home
logologo
RunJS Overview
Import Modules
Render in Container

Globals

window
document
navigator

ctx

ctx.blockModel
ctx.collection
ctx.collectionField
ctx.dataSource
ctx.dataSourceManager
ctx.element
ctx.exit()
ctx.exitAll()
ctx.filterManager
ctx.form
ctx.getModel()
ctx.getValue()
ctx.getVar()
ctx.i18n
ctx.importAsync()
ctx.initResource()
ctx.libs
ctx.location
ctx.logger
ctx.makeResource()
ctx.message
ctx.modal
ctx.model
ctx.notification
ctx.off()
ctx.on()
ctx.openView()
ctx.render()
ctx.request()
ctx.requireAsync()
ctx.resource
ctx.route
ctx.router
ctx.setValue()
ctx.sql
ctx.t()
ctx.view
Previous Pagectx.modal
Next Pagectx.notification

#ctx.model

The current FlowModel instance.

#Type definition (simplified)

model: FlowModel;

In practice, FlowModel has different subclasses (e.g. BlockModel, ActionModel, PageModel). Available properties and methods vary by type and are not listed exhaustively here.

Common members (not all models have them):

  • uid: string - unique model identifier, can be used with ctx.getModel(uid) or as a filter/modal UID binding
  • collection?: Collection - collection bound to the model (if any)
  • resource?: Resource - resource instance associated with the model (e.g. table, detail)
  • subModels?: Record<string, FlowModel> - sub-models, such as column models in tables or field models in forms
  • setProps(partialProps: any): void - update UI/behavior config of the model
  • dispatchEvent(event: { type: string; payload?: any }): void - dispatch event to trigger internal logic

Tips:

  • ctx.model always points to the current flow/block model and is the default entry for JSBlock/JSField/Action
  • Use ctx.getModel(uid) to access other blocks/actions across models
  • If you only need block-level info (table/form), use ctx.blockModel