This documentation is currently being moved to our new documentation site.

Please view or edit the documentation there, instead.

If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Wherever possible, use event boiling instead of firing events manually using the fire() function. If a component needs to know when something happens in one of its subcomponent, declare the parent event as a listener for the child's event:

/* The subcomponent defines an event that will fire at some point */
fluid.defaults("my.component.kid", {
    ...
    events: {
        childEvent: null
    }
});

/* The root component declares an event that becomes a listener for the subcomponent's event */
fluid.defaults("my.component", {
    ...
    events: {
        myEvent: null
    },
    components: {
        child: {
            type: "my.component.kid"
            listeners: {
                childEvent: "{parent}.myEvent"
            }
        }
    }
});
  • No labels