Application Framework Reference

Module API

pushContextToChildren()

The pushContextToChildren() method passes the current module context to all child modules.

Note: This method is not intended to be overridden. It is recommended that you use onContextChange() to refine the context before it is passed to children.

Synopsis

results = pushContextToChildren( explicitContext )

Parameters

explicitContext

Object

Explicit context to be passed to children. If omitted, getContext() is called to provide the context.

Return Value

Undefined

Example

_onMenuClick: function(evt) {
    var t = evt.target;
    if ( $(t).parent('li').hasClass('timeRangePreset') ) { 
        this._setSelectedRangeToPreset($(t));
        this.setParam('default', this._getRawLabel($(t).text()));

        if (Splunk.util.normalizeBoolean(this.getParam('searchWhenChanged'))) {
            this.pushContextToChildren();
        } else {
            this.setChildContextFreshness(false);
        }  
        $('.timeRangeActivator', this.container).text($(t).text());
    }  
},
 

See Also

applyContext()
ensureFreshContexts()
getContext()
getModifiedContext()
onContextChange()
passContextToParent()
Splunk.Context