Changes between Version 1 and Version 2 of Cookbook/Fusion/Events


Ignore:
Timestamp:
Jun 19, 2008, 7:33:27 AM (16 years ago)
Author:
pdeschamps
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Cookbook/Fusion/Events

    v1 v2  
    55For this example lets use the legend widget.
    66
    7 First add the new event obj, before the "OpenLayers.Class(Fusion.Widget"
     7First 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++;'''
    811
    912{{{
     
    1720}}}
    1821
    19 Next bind this event to the init section of the class around line 70:
     22Next 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);'''
    2026
    2127{{{
     
    3238}}}
    3339
    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:
     40Now 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
    3545
    3646{{{