Outline
- Creating Views
- use SC.View.create(). Define any properties you want added to the view, including bindings, child views, etc.
- Designing Views
- Use SC.View.design(). This works a lot like extend() except it will optimize certain properties differently. You also cannot extend a design, whereas you can extend a view.
- Extending Views
- The view creation process
- The view display process
- Creating views with children
- Using SC.Control
- Example
- Define a view with some properties to bind to a controller
- Mapping the input properties to display properties
- Writing
firstResponder vs keyResponder
A view can be firstResponder and keyResponder. firstResponder means that the view will be the first view to receive events directed at that pane. keyResponder means that the view is firstResponder AND the pane is keyPane. If a view is keyResponder, it means that keyboard events will be delivered to that view.
Normally you only need to design your code around when you gain or lose firstResponder status. However, if you are implementing keyboard editing, you may need to know when you gain/lose keyResponder status additionally to show proper UI.
isMainPane, blurMainTo(), focusMainFrom()
When your view gains or loses its mainPane status, the blurMainTo() and focusMainFrom() methods are called. You can override these to do any setup. This is sort of equivalent to bringing your application's main window 'to the front'.
Comments (0)
You don't have permission to comment on this page.