• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Views-UsingViews

Page history last edited by Eric Retzloff 15 years, 1 month ago

Outline

  1. Creating Views
    1. use SC.View.create().  Define any properties you want added to the view, including bindings, child views, etc.
  2. Designing Views
    1. 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.
  3. Extending Views
    1. The view creation process
    2. The view display process
    3. Creating views with children
    4. Using SC.Control
    5. Example
      1. Define a view with some properties to bind to a controller
      2. Mapping the input properties to display properties
      3. 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.