Mixin: SC.ResponderContext
The root object for a responder chain. A responder context can dispatch actions directly to a first responder; walking up the responder chain until it finds a responder that can handle the action.
If no responder can be found to handle the action, it will attempt to send
the action to the defaultResponder
.
You can have as many ResponderContext's as you want within your application.
Every SC.Pane
and SC.Application
automatically implements this mixin.
Note that to implement this, you should mix SC.ResponderContext
into an
SC.Responder
or SC.Responder
subclass.
Defined in: responder_context.js
- Since:
- SproutCore 1.0
Field Summary
- SC.ResponderContext.defaultResponder
- SC.ResponderContext.firstResponder
- SC.ResponderContext.trace
Class Methods
- makeFirstResponder(responder, evt)
- nextResponder()
- nextResponderFor(responder)
- resetFirstResponder()
- responderNameFor(responder)
- sendAction(action, sender, context)
Field Detail
SC.ResponderContext.defaultResponder SC.ResponderClass Method Detail
Makes the passed responder into the new firstResponder
for this
responder context. This will cause the current first responder to lose
its responder status and possibly keyResponder
status as well.
When you change the first responder, this will send callbacks to responders up the chain until you reach a shared responder, at which point it will stop notifying.
- Parameters:
- responder SC.Responder
- evt Event
- that cause this to become first responder
- Returns:
- SC.ResponderContext
- receiver
Finds the next responder for the passed responder based on the responder's
nextResponder
property. If the property is a string, then lookup the path
in the receiver.
- Parameters:
- responder
- Parameters:
- responder
Send the passed action down the responder chain, starting with the
current first responder. This will look for the first responder that
actually implements the action method and returns YES
or no value when
called.
- Parameters:
- action String
- name of action
- sender Object
- object sending the action
- context Object Optional
- additional context info
- Returns:
- SC.Responder
- the responder that handled it or null