com.extjs.gxt.ui.client.widget.grid
Class RowExpander

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.widget.grid.ColumnConfig
          extended by com.extjs.gxt.ui.client.widget.grid.RowExpander
All Implemented Interfaces:
Observable, ComponentPlugin

public class RowExpander
extends ColumnConfig
implements ComponentPlugin

A ColumnConfig subclass and a ComponentPlugin that adds the ability for each row to be expanded, showing custom content that spans all the rows columns.

Events:
BeforeExpand : RowExpanderEvent(rowExpander, model, rowIndex, bodyElement)
Fires before a row is expanded. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
  • rowExpander : this
  • model : the model
  • rowIndex : the row index
  • bodyElement : the body element
Expand : RowExpanderEvent(rowExpander, model, rowIndex, bodyElement)
Fires after a row is expanded.
  • rowExpander : this
  • model : the model
  • rowIndex : the row index
  • bodyElement : the body element
BeforeCollapse : RowExpanderEvent(rowExpander, model, rowIndex, bodyElement)
Fires before a row is collapsed. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
  • rowExpander : this
  • model : the model
  • rowIndex : the row index
  • bodyElement : the body element
Collapse : RowExpanderEvent(rowExpander, model, rowIndex, bodyElement)
Fires after a row is collapsed.
  • rowExpander : this
  • model : the model
  • rowIndex : the row index
  • bodyElement : the body element


Field Summary
protected  Grid<ModelData> grid
           
 
Fields inherited from class com.extjs.gxt.ui.client.widget.grid.ColumnConfig
ariaIgnore
 
Constructor Summary
RowExpander()
          Creates a new row expander.
RowExpander(XTemplate template)
          Creates a new row expander with the given template.
 
Method Summary
protected  boolean beforeExpand(ModelData model, com.google.gwt.user.client.Element body, El row, int rowIndex)
           
protected  void collapseRow(El row)
           
 void collapseRow(int rowIndex)
          Collapses the given row.
protected  void expandRow(El row)
           
 void expandRow(int rowIndex)
          Expands the given row.
protected  java.lang.String getBodyContent(ModelData model, int rowIndex)
           
 Grid<?> getGrid()
          Returns the source grid.
 XTemplate getTemplate()
          Returns the template.
 void init(Component component)
          Initializes the plugin when the component is created.
protected  boolean isExpanded(El row)
           
protected  void onKeyLeft(GridEvent<?> ce)
           
protected  void onKeyRight(GridEvent<?> ce)
           
protected  void onMouseDown(GridEvent<?> e)
           
 void setTemplate(XTemplate template)
          Sets the template.
protected  void toggleRow(El row)
           
 
Methods inherited from class com.extjs.gxt.ui.client.widget.grid.ColumnConfig
getAlignment, getColumnStyleName, getDataIndex, getDateTimeFormat, getEditor, getHeader, getId, getNumberFormat, getRenderer, getStyle, getToolTip, getWidget, getWidth, isFixed, isGroupable, isHidden, isMenuDisabled, isResizable, isRowHeader, isSortable, setAlignment, setColumnStyleName, setDataIndex, setDateTimeFormat, setEditor, setFixed, setGroupable, setHeader, setHidden, setId, setMenuDisabled, setNumberFormat, setRenderer, setResizable, setRowHeader, setSortable, setStyle, setToolTip, setWidget, setWidth
 
Methods inherited from class com.extjs.gxt.ui.client.event.BaseObservable
addListener, callListener, fireEvent, fireEvent, getFiresEvents, getListeners, hasActiveEvent, hasListeners, hasListeners, removeAllListeners, removeListener, setFiresEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grid

protected Grid<ModelData> grid
Constructor Detail

RowExpander

public RowExpander()
Creates a new row expander.


RowExpander

public RowExpander(XTemplate template)
Creates a new row expander with the given template.

Parameters:
template - the template
Method Detail

collapseRow

public void collapseRow(int rowIndex)
Collapses the given row.

Parameters:
rowIndex - the rowIndex

expandRow

public void expandRow(int rowIndex)
Expands the given row.

Parameters:
rowIndex - the row index

getGrid

public Grid<?> getGrid()
Returns the source grid.

Returns:
the source grid

getTemplate

public XTemplate getTemplate()
Returns the template.

Returns:
the template

init

public void init(Component component)
Description copied from interface: ComponentPlugin
Initializes the plugin when the component is created.

Specified by:
init in interface ComponentPlugin
Parameters:
component - the source component

setTemplate

public void setTemplate(XTemplate template)
Sets the template.

Parameters:
template - the template

beforeExpand

protected boolean beforeExpand(ModelData model,
                               com.google.gwt.user.client.Element body,
                               El row,
                               int rowIndex)

isExpanded

protected boolean isExpanded(El row)

collapseRow

protected void collapseRow(El row)

expandRow

protected void expandRow(El row)

getBodyContent

protected java.lang.String getBodyContent(ModelData model,
                                          int rowIndex)

onKeyLeft

protected void onKeyLeft(GridEvent<?> ce)

onKeyRight

protected void onKeyRight(GridEvent<?> ce)

onMouseDown

protected void onMouseDown(GridEvent<?> e)

toggleRow

protected void toggleRow(El row)