Changes between Version 1 and Version 2 of Cookbook/Fusion/Events
- Timestamp:
- 06/19/08 07:33:27 (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Cookbook/Fusion/Events
v1 v2 5 5 For this example lets use the legend widget. 6 6 7 First add the new event obj, before the "OpenLayers.Class(Fusion.Widget" 7 First add the new event obj, before the "OpenLayers.Class(Fusion.Widget"[[BR]] 8 9 '''Fusion.Event.LEGEND_LAYER_VIS_ON = Fusion.Event.lastEventId++;'''[[BR]] 10 '''Fusion.Event.LEGEND_LAYER_VIS_OFF = Fusion.Event.lastEventId++;''' 8 11 9 12 {{{ … … 17 20 }}} 18 21 19 Next bind this event to the init section of the class around line 70: 22 Next register this event to the init section of the class around line 70:[[BR]] 23 24 '''this.registerEventID(Fusion.Event.LEGEND_LAYER_VIS_ON);'''[[BR]] 25 '''this.registerEventID(Fusion.Event.LEGEND_LAYER_VIS_OFF);''' 20 26 21 27 {{{ … … 32 38 }}} 33 39 34 Now trigger the event in the legend class, for this we want to trigger it when the layer checkbox is clicked: around line 499: 40 Now trigger the event in the legend class, for this we want to trigger it when the layer checkbox is clicked: around line 499:[[BR]] 41 42 '''this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_ON, obj);'''[[BR]] 43 '''this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_OFF, obj);''' 44 35 45 36 46 {{{