Every repository with this icon (
Every repository with this icon (
Creating Views

1. createChildViews() – this method will create any child views. The default loops through the childViews array (which it expects to hold SC.View CLASSES) and calls this.createChildView(viewClass) on each one. You can override this method to do your own setup also. See SC.ContainerView or SC.ScrollView for examples.
2. prepareDisplay() – this method is called when we need to actually generate the HTML for the view. The default implementation will simply clone the emptyElement HTML and do a little bit of extra setup. You can override this, call sc_super() and then do extra one-time setup you would want frozen into the HTML.
3. updateDisplay() – this method is called whenever the view state changes. It is also called once after prepareDisplay() unless you set updateDisplayOnPrepare to NO.
4. init() – override this method to do any extra one time setup needed on init that does not actually touch the HTML, such as setting up observers, etc.
Note that in the “fast” optimized mode, steps 2-3 above are skipped. See below:






