Home

# Class goog.ui.DrilldownRow

Builds a DrilldownRow component, which can overlay a tree structure onto sections of an HTML table.

extends goog.ui.Component

Instance Method Summary
| `addChildAt(?goog.ui.DrilldownRow child, number index, boolean= opt_render)` Child drilldowns are rendered when needed.
| `canDecorate(?Element node) ⇒ boolean` A top-level DrilldownRow decorates a TR element.
| `createDom()` Creates the initial DOM representation for the component. The default implementation is to set this.element_ = div.
| `disposeInternal()` Disposes of the component. Calls {@code exitDocument}, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.
| `enterDocument()` The base class method calls its superclass method and this drilldown's 'decorator' method as defined in the constructor.
| `findIndex() ⇒ number` Finds the numeric index of this child within its parent Component. Throws an exception if it has no parent.
| `getDepth() ⇒ number` Returns this DrilldownRow's level in the tree. Top level is 1.
| `isExpanded() ⇒ boolean` Returns the expanded state of the DrilldownRow.
| `isVisible_() ⇒ boolean` True iff this and all its DrilldownRow parents are displayable. The value is an approximation to actual visibility, since it does not look at whether DOM nodes containing the top-level component have display: none, visibility: hidden or are otherwise not displayable. So this visibility is relative to the top-level component.
| `lastRenderedLeaf_() ⇒ ?goog.ui.DrilldownRow` Get the recursively rightmost child that is in the document.
| `previousRenderedChild_(?goog.ui.DrilldownRow child) ⇒ ?goog.ui.Component` Search this node's direct children for the last one that is in the document and is before the given child.

`removeChild((goog.ui.Component|null|string) child, boolean= opt_unrender) ⇒ ?goog.ui.Component`

Removes the given child from this component, and returns it. Throws an error if the argument is invalid or if the specified child isn't found in the parent component. The argument can either be a string (interpreted as the ID of the child component to remove) or the child component itself. If {@code opt_unrender} is true, calls {@link goog.ui.component#exitDocument} on the removed child, and subsequently detaches the child's DOM from the document. Otherwise it is the caller's responsibility to clean up the child component's DOM.

| `render()` Rendering of DrilldownRow's is on need, do not call this directly from application code. Rendering a DrilldownRow places it according to its position in its tree of DrilldownRows. DrilldownRows cannot be placed any other way so this method does not use any arguments. This does not call the base class method and does not modify any of this DrilldownRow's children.
| `setDisplayable_(boolean display)` Turn display of a DrilldownRow on or off. If the DrilldownRow has not yet been rendered, this renders it. This propagates the effect of the change recursively as needed -- children displaying iff the parent is displayed and expanded.
| `setExpanded(boolean expanded)` Sets the expanded state of this DrilldownRow: makes all children displayable or not displayable corresponding to the expanded state.

Static Method Summary
| `createRowNode_(string html, ?Document doc) ⇒ ?Element` Create and return a TR element from HTML that looks like "
...
".

`decorate(?goog.ui.DrilldownRow selfObj)`

This static function is a default decorator that adds HTML at the beginning of the first cell to display indentation and an expander image; sets up a click handler on the toggler; initializes a class for the row: either goog-drilldown-expanded or goog-drilldown-collapsed, depending on the initial state of the DrilldownRow; and sets up a click event handler on the toggler element. This creates a DIV with class=toggle. Your application can set up CSS style rules something like this: tr.goog-drilldown-expanded .toggle { background-image: url('minus.png'); } tr.goog-drilldown-collapsed .toggle { background-image: url('plus.png'); } These background images show whether the DrilldownRow is expanded.