Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This component has public methods that can be invoked by integrators as necessary. Some of these methods may be These methods are typcially implemented as Invokers, which resolve their arguments from the environment at invocation time. These methods can be configured by the integrator if necessary: arguments can be changed, and in fact the entire implementation function can be replaced by a custom function (though it is likely rare that this would be necessary or desirable).

Configuration of invokers is carried out using Demands Specificationsshould be carried by creating a grade, using the following pattern:

Code Block
javascript
javascript

fluid.demandsdefaults("component.name", [<context><new name of overriding grade>", {
    gradeNames: ["<name of grade being overridden", "autoInit"],
{     invokers invokers: {
        <invokerName>: {
            funcName: <implementation function name>,
            args: [<array of argument specifications>]
        }
    }
});

Example of overriding an invoker

The Infusion Pager component has a method called {{acquireDefaultRange}} which, by default, simply returns the total range. An integrator may wish to override this using their own custom function:

Code Block
javascript
javascript
fluid.defaults("my.pager", {
    gradeNames: ["fluid.pager", "autoInit"],
    invokers: {
        acquireDefaultRange: {
            funcName: "my.pager.acquireDefaultRange
        }
    }
});