Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ActionController

ActionController is a controller used to trigger JS functions

How to use


const callback = (a, b) => {
return a + b
}
const target = { action: callback }

// Method 1
const action = group.action(callback, { args: [{ value: 1, name: 'a'}, { value: 1, name: 'b'}] })

// Method 2
action = group.add('action', target, { args: [{ value: 1, name: 'a'}, { value: 1, name: 'b'}] })

// Manually trigger action
action.run()

More information ActionControllerConstructor BaseController

Hierarchy

Index

Methods

  • run(event: any): void
  • forceUpdate(): void
  • Manually update controller value in the form if target has changed

    Returns void

  • destroy(): void
  • Delete the controller

    Returns void

  • add(property: string, target?: Object, params?: any): void
  • Add a controller in the same Group of current controller

    Parameters

    • property: string
    • target: Object = undefined
    • params: any = undefined

    Returns void

  • valueOf(): any

Properties

listen: boolean = false

If true, the controller value will be updated automatically if target object is modified. Carefull: heavy use may reduce performance

group.add('someProperty', target, { listen: true })
disabled: boolean = false

If true, the controller will not be editable

name: string

Display name of a controller, defaultly equal to property.

group.add('someProperty', target, { name: 'Custom display name' })
property: string

property controlled in the target object

target: Object

source object in which the property key is defined

parent: BaseGroup

Generated using TypeDoc