events

Purpose

Provide application event handlers.

Examples


class SampleGriffonAddon {
    def events = [
        NewInstance: { klass, type, instance ->
            if(type != "controller") return
            instance.metaClass.doit = { evt = null ->
                // action code goes here
            }
        }
    ]
}

Description

The events property is responsible for providing additional application event handlers. Each event handler is defined by a key (matches the name of the event) and a value (a closure matching the event's arguments).