[fusion-users] Adding Events In Fusion

Rodolfo Moreno rodolfoamoreno at gmail.com
Tue Nov 26 22:49:21 PST 2013


Hi All,
I want to add an event to fusion, exactly in the moment when the user turns
on or off a layer.
I saw the code sample in the COOKBOOK:
http://trac.osgeo.org/fusion/wiki/Cookbook/Fusion/Events
I followed all steps of the COOKBOOK however I get an error on the following
line:

stateChanged: function(obj, event) {
        if (obj.legend && obj.legend.treeItem.checkBox) {
            if (obj.legend.treeItem.checkBox.checked) {
                *this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_ON, obj);*
                obj.show();
            } else {
                this.triggerEvent(Fusion.Event.LEGEND_LAYER_VIS_OFF, obj);
                obj.hide();
            }
        }
        OpenLayers.Event.stop(event, true);
    },

The message that I got is: "The object does not support this property or
method"
In the debug mode I saw that effectively *this* object does not have the
triggerEvent method.
I suppose that this error is due to the code sample from the cookbook is
related with older fusion versions.

I am using the fusion version that come with MapGuide OS 2.2 
I would appreciate so much for any suggestions. Thanks in advance.
Rodolfo







--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Adding-Events-In-Fusion-tp5091395.html
Sent from the Fusion Users mailing list archive at Nabble.com.


More information about the fusion-users mailing list