containerrenderer.js
No description.

File Location

/goog/ui/containerrenderer.js

Classes

goog.ui.ContainerRenderer
Default renderer for goog.ui.Container. Can be used as-is, but subclasses of Container will probably want to use renderers specifically tailored for them by extending this class.

Public Protected Private

Global Functions

goog.ui.ContainerRenderer.getCustomRenderer&renderer.getCssClass() string
Returns the CSS class to be applied to the root element of components rendered using this renderer.
Returns: string  Renderer-specific CSS class.
code »
goog.ui.ContainerRenderer.getCustomRenderer(ctorcssClassName) goog.ui.ContainerRenderer
Constructs a new renderer and sets the CSS class that the renderer will use as the base CSS class to apply to all elements rendered by that renderer. An example to use this function using a menu is:
var myCustomRenderer = goog.ui.ContainerRenderer.getCustomRenderer(
    goog.ui.MenuRenderer, 'my-special-menu');
var newMenu = new goog.ui.Menu(opt_domHelper, myCustomRenderer);
Your styles for the menu can now be:
.my-special-menu { }
instead of
.CSS_MY_SPECIAL_MENU .goog-menu { }
You would want to use this functionality when you want an instance of a component to have specific styles different than the other components of the same type in your application. This avoids using descendant selectors to apply the specific styles to this component.
Arguments:
ctor : Function
The constructor of the renderer you want to create.
cssClassName : string
The name of the CSS class for this renderer.
Returns: goog.ui.ContainerRenderer  An instance of the desired renderer with its getCssClass() method overridden to return the supplied custom CSS class name.
code »
goog.ui.ContainerRenderer.getInstance()
No description.
code »

Directory ui

File Reference