Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gwtext.client.widgets.grid
Class GridPanel

    java.lang.Object
      com.google.gwt.user.client.ui.UIObject
          com.google.gwt.user.client.ui.Widget
              com.gwtext.client.widgets.Component
                  com.gwtext.client.widgets.BoxComponent
                      com.gwtext.client.widgets.Container
                          com.gwtext.client.widgets.Panel
                              com.gwtext.client.widgets.grid.GridPanel

All Implemented Interfaces:
  com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasWidgets, Observable

Direct Known Subclasses:
  EditorGridPanel

    public class GridPanel

extends Panel

A Grid widget.
Common Problems:

- Grid does not resize properly when going smaller: Setting overflow hidden on the container element will correct this
- If you get el.style[camel]= NaNpx or -2px or something related, be certain you have given your container element dimensions. The grid adapts to your container's size, if your container has no size defined then the results are unpredictable.
- Do not render the grid into an element with display:none. Try using visibility:hidden. Otherwise there is no way for the grid to calculate dimensions/offsets.

CSS can be used to style or customize the behaviour of headers an cells.
For example, use this to wrap all cell contents globally

     .x-grid3-cell-inner {
          overflow: visible; white-space: normal !important;
     }

To wrap cell contents on a certain table only, set an ID to the Grid panel (say company-grid) and then use the CSS

     #company-grid  .x-grid3-cell-inner {
          overflow: visible; white-space: normal !important;
     }

To wrap long header titles For all grids

     .x-grid3-hd-inner  {
         overflow: visible; white-space: normal;
     }

For specific grid

     #company-grid .x-grid3-hd-inner  {
         overflow: visible; white-space: normal;
     }

For specific column

     .x-grid3-hd-company {
          overflow: visible; white-space: normal !important;
     }

Field Summary

Fields inherited from class com.gwtext.client.widgets.Component
`config, id`

Constructor Summary
`GridPanel()`
`GridPanel(com.google.gwt.core.client.JavaScriptObject jsObj)`
`GridPanel(Store store, ColumnModel columnModel)` Creates a new Grid.
`GridPanel(java.lang.String id, int width, int height, Store store, ColumnModel columnModel)` Creates a new Grid.

Method Summary
`void` | `addGridCellListener(GridCellListener listener)` Add a Grid Cell listener.
`void` | `addGridColumnListener(GridColumnListener listener)` Add a Grid Column listener.
`void` | `addGridHeaderListener(GridHeaderListener listener)` Add a Grid Header listener.
`void` | `addGridListener(GridListener listener)` Add a Grid Cell listener.
`void` | `addGridMouseListener(GridMouseListener listener)` Add a Grid mouse listener.
`void` | `addGridRowListener(GridRowListener listener)` Add a Grid row listener.
`protected com.google.gwt.core.client.JavaScriptObject` | `create(com.google.gwt.core.client.JavaScriptObject configJS)`
`ColumnModel` | `getColumnModel()` Returns the grid's ColumnModel.
`protected com.google.gwt.core.client.JavaScriptObject` | `getConfigPrototype()`
`java.lang.String` | `getDragDropText()` Called to get Grid's drag proxy text.
`RowSelectionModel` | `getSelectionModel()` Returns the Grid's row selection model
`Store` | `getStore()` Returns the Grid's Store
`GridView` | `getView()` Returns the grid's GridView object.
`java.lang.String` | `getXType()` Gets the xtype for this component as registered with ComponentMgr.
`void` | `hideColumn(int colIndex)` Hides the specified column.
`void` | `hideColumn(java.lang.String colID)` Hides the specified column.
`void` | `hideColumnHeader()` Hides the column header of the grid.
`protected void` | `initComponent()` This template method is called after the Component has been instantiated but before it's rendered.
`void` | `reconfigure(Store store, ColumnModel columnModel)` Reconfigures the grid to use a different Store and Column Model.
`void` | `render(com.google.gwt.core.client.JavaScriptObject grid)`
`void` | `setAutoExpandColumn(int autoExpandColumn)` The id of a column in this grid that should expand to fill unused space.
`void` | `setAutoExpandColumn(java.lang.String autoExpandColumn)` The id of a column in this grid that should expand to fill unused space.
`void` | `setAutoExpandMax(int autoExpandMax)` The maximum width the autoExpandColumn can have (if enabled).
`void` | `setAutoExpandMin(int autoExpandMin)` The minimum width the autoExpandColumn can have (if enabled).
`void` | `setAutoHeight(boolean autoHeight)` True to fit the height of the grid container to the height of the data.
`void` | `setColumnModel(ColumnModel columnModel)` The `ColumnModel` to use when rendering the grid (required).
`void` | `setDdGroup(java.lang.String ddGroup)` The DD group this GridPanel belongs to (defaults to 'GridDD').
`void` | `setDragDropText(java.lang.String text)` Sets the Grid's drag drop text
`void` | `setEnableColumnHide(boolean enableColumnHide)` True to enable hiding of columns with the header context menu.
`void` | `setEnableColumnMove(boolean enableColumnMove)` True to enable drag and drop reorder of columns.
`void` | `setEnableColumnResize(boolean enableColumnResize)` True to enable column resize.
`void` | `setEnableCtxMenu(boolean enableCtxMenu)` True to enable Grid context menus.
`void` | `setEnableDragDrop(boolean enableDragDrop)` True to enable drag and drop of rows.
`void` | `setHideColumnHeader(boolean hideColumnHeader)` Hides the column header of the grid if passed true.
`void` | `setLoadMask(boolean loadMask)` True to mask the grid while loading.
`void` | `setLoadMask(java.lang.String message)` Sets the load mask message for the grid.
`void` | `setLoadMask(java.lang.String message, java.lang.String messageCls)` Sets the `LoadMask` to mask the grid while loading.
`void` | `setMaxRowsToMeasure(int maxRowsToMeasure)` If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of rows measured to get a columns size.
`void` | `setMinColumnWidth(int minColumnWidth)` The minimum width a column can be resized to.
`void` | `setMonitorWindowResize(boolean monitorWindowResize)` True to autoSize the grid when the window resizes.
`void` | `setSelectionModel(AbstractSelectionModel selectionModel)` Set the GridPanel's selection model.
`void` | `setStore(Store store)` The Store the grid should use as its data source (required).
`void` | `setStripeRows(boolean stripeRows)` True to stripe the rows.
`void` | `setTrackMouseOver(boolean trackMouseOver)` True to highlight rows when the mouse is over.
`void` | `setView(GridView view)` Sets the `GridView` used by the grid.
`void` | `showColumn(int colIndex)` Shows the specified column.
`void` | `showColumn(java.lang.String colID)` Show the specified column.
`void` | `stripeRows(boolean stripeRows)` True to stripe the rows.

Methods inherited from class com.gwtext.client.widgets.Panel
`addButton, addListener, addTool, collapse, collapse, expand, expand, getBaseCls, getBody, getBodyStyle, getBodyWrap, getBottomToolbar, getCollapsedCls, getCollapseFirst, getFloating, getFooter, getFrameHeight, getFrameWidth, getHeader, getHtml, getIconCls, getInnerHeight, getInnerWidth, getMinButtonWidth, getShadowOffset, getTitle, getTopToolbar, getUpdateManager, isAnimCollapse, isAutoScroll, isBodyBorder, isBorder, isClosable, isCollapsed, isCollapsible, isFrame, isHeader, isHeaderAsText, isHideCollapseTool, isMaskDisabled, isShadow, isShim, isTitleCollapse, load, load, setAnimCollapse, setAutoLoad, setAutoLoad, setAutoScroll, setBaseCls, setBodyBorder, setBodyStyle, setBorder, setBottomToolbar, setBottomToolbar, setBottomToolbar, setButtonAlign, setButtons, setClosable, setCollapsed, setCollapsedCls, setCollapseFirst, setCollapsible, setContentEl, setDraggable, setFloating, setFooter, setFrame, setHeader, setHeaderAsText, setHideCollapseTool, setHtml, setIconCls, setMargins, setMargins, setMaskDisabled, setMinButtonWidth, setPaddings, setPaddings, setShadow, setShadow, setShadowOffset, setShim, setStyleName, setTitle, setTitle, setTitleCollapse, setTools, setTopToolbar, setTopToolbar, setTopToolbar, toggleCollapse, toggleCollapse`

Methods inherited from class com.gwtext.client.widgets.Container
`add, add, add, add, addListener, bubble, cascade, clear, doLayout, findBy, findByID, findByType, getActiveItem, getActiveItemID, getAutoDestroy, getBufferResize, getComponent, getComponent, getComponents, getHideBorders, getItems, getLayout, getMonitorResize, insert, iterator, remove, remove, remove, remove, removeAll, removeAll, setActiveItem, setActiveItemID, setAutoDestroy, setBufferResize, setDefaults, setHideBorders, setLayout, setMonitorResize`

Methods inherited from class com.gwtext.client.widgets.BoxComponent
`addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getHeight, getPosition, getPosition, getSize, getWidth, setAutoWidth, setHeight, setHeight, setPagePosition, setPosition, setWidth, setWidth, syncSize, updateBox`

Methods inherited from class com.gwtext.client.widgets.Component
`addClass, addClassCreated, addEvent, addEvents, addListener, addListener, addListener, afterRender, beforeDestroy, check, cloneComponent, cloneComponent, cloneConfig, destroy, disable, enable, equals, error, focus, focus, focus, getApplyTo, getAttribute, getAttributeAsBoolean, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAutoShow, getCls, getComponentJS, getConfig, getCtCls, getDisabledClass, getEl, getElement, getElement, getHideMode, getHideParent, getId, getItemId, getJsObj, getOffsetHeight, getOffsetWidth, getOrCreateJsObj, getOwnerContainer, getRenderTo, getStateEvents, getStateId, getStyle, getStyleElement, getXTypes, hashCode, hide, isCreated, isDisabled, isHidden, isRendered, isVisible, isXType, isXType, onDestroy, removeClass, render, render, render, render, render, render, setApplyTo, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoEl, setAutoShow, setCls, setCtCls, setDisabled, setDisabledClass, setEl, setEl, setHideMode, setHideParent, setId, setRenderTo, setStateEvents, setStateId, setStyle, setVisible, show`

Methods inherited from class com.google.gwt.user.client.ui.Widget
`doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setElement`

Methods inherited from class com.google.gwt.user.client.ui.UIObject
`addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, removeStyleName, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, toString, unsinkEvents`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### GridPanel

    public GridPanel(com.google.gwt.core.client.JavaScriptObject jsObj)

### GridPanel

    public GridPanel()

### GridPanel

    public GridPanel(Store store,
                     ColumnModel columnModel)

  Creates a new Grid.

  Parameters:
    `store` - the Grid's data store
    `columnModel` - the Grid's column model

### GridPanel

    public GridPanel(java.lang.String id,
                     int width,
                     int height,
                     Store store,
                     ColumnModel columnModel)

  Creates a new Grid.

  Parameters:
    `id` - the Grid ID
    `width` - the Grid width
    `height` - the Grid height
    `store` - the Grid's data store
    `columnModel` - the Grid's column model

Method Detail

### getConfigPrototype

    protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()

  Overrides:
    `getConfigPrototype` in class `Panel`

### getXType

    public java.lang.String getXType()

  Description copied from class: `Component`
  Gets the xtype for this component as registered with ComponentMgr. For a list of all available xtypes, see the Component javadocs.

       TextField field = new TextField();
       field.getXType() returns "textfield"

  Overrides:
    `getXType` in class `Panel`
  Returns:
    the xtype

### create

    protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject configJS)

  Overrides:
    `create` in class `Panel`

### initComponent

    protected void initComponent()

  Description copied from class: `Component`
  This template method is called after the Component has been instantiated but before it's rendered. Subclasses can override it to provide any "constructor" type logic thats desired/

  Overrides:
    `initComponent` in class `Component`

### getColumnModel

    public ColumnModel getColumnModel()

  Returns the grid's ColumnModel.

  Returns:
    the column model

### getStore

    public Store getStore()

  Returns the Grid's Store

  Returns:
    the Grids Store

### getDragDropText

    public java.lang.String getDragDropText()

  Called to get Grid's drag proxy text.

  Returns:
    the grids drag drop text

### setDragDropText

    public void setDragDropText(java.lang.String text)

  Sets the Grid's drag drop text

  Parameters:
    `text` - the drag drop text

### getSelectionModel

    public RowSelectionModel getSelectionModel()

  Returns the Grid's row selection model

  Returns:
    the selection model

### getView

    public GridView getView()

  Returns the grid's GridView object.

  Returns:
    grid view

### hideColumn

    public void hideColumn(java.lang.String colID)

  Hides the specified column.

  Parameters:
    `colID` - the column ID

### hideColumn

    public void hideColumn(int colIndex)

  Hides the specified column.

  Parameters:
    `colIndex` - the column index

### hideColumnHeader

    public void hideColumnHeader()

  Hides the column header of the grid.

### render

    public void render(com.google.gwt.core.client.JavaScriptObject grid)

### reconfigure

    public void reconfigure(Store store,
                            ColumnModel columnModel)

  Reconfigures the grid to use a different Store and Column Model. The View will be bound to the new objects and refreshed.

  Parameters:
    `store` - the new Store
    `columnModel` - the new ColumnModel

### setLoadMask

    public void setLoadMask(java.lang.String message)

  Sets the load mask message for the grid.

  Parameters:
    `message` - the load mask text

### showColumn

    public void showColumn(java.lang.String colID)

  Show the specified column.

  Parameters:
    `colID` - the column ID

### showColumn

    public void showColumn(int colIndex)

  Shows the specified column.

  Parameters:
    `colIndex` - the column index

### addGridCellListener

    public void addGridCellListener(GridCellListener listener)

  Add a Grid Cell listener.

  Parameters:
    `listener` - the listener

### addGridColumnListener

    public void addGridColumnListener(GridColumnListener listener)

  Add a Grid Column listener.

  Parameters:
    `listener` - the listener

### addGridHeaderListener

    public void addGridHeaderListener(GridHeaderListener listener)

  Add a Grid Header listener.

  Parameters:
    `listener` - the listener

### addGridListener

    public void addGridListener(GridListener listener)

  Add a Grid Cell listener.

  Parameters:
    `listener` - the listener

### addGridMouseListener

    public void addGridMouseListener(GridMouseListener listener)

  Add a Grid mouse listener.

  Parameters:
    `listener` - the listener

### addGridRowListener

    public void addGridRowListener(GridRowListener listener)

  Add a Grid row listener.

  Parameters:
    `listener` - the listener

### setDdGroup

    public void setDdGroup(java.lang.String ddGroup)
                    throws java.lang.IllegalStateException

  The DD group this GridPanel belongs to (defaults to 'GridDD').

  Parameters:
    `ddGroup` - the DD group
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setMinColumnWidth

    public void setMinColumnWidth(int minColumnWidth)
                           throws java.lang.IllegalStateException

  The minimum width a column can be resized to. Default is 25.

  Parameters:
    `minColumnWidth` - the min column width
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setMonitorWindowResize

    public void setMonitorWindowResize(boolean monitorWindowResize)
                                throws java.lang.IllegalStateException

  True to autoSize the grid when the window resizes. Default is true.

  Parameters:
    `monitorWindowResize` - true to monitor window resize
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setMaxRowsToMeasure

    public void setMaxRowsToMeasure(int maxRowsToMeasure)
                             throws java.lang.IllegalStateException

  If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of rows measured to get a columns size. Default is 0 (all rows).

  Parameters:
    `maxRowsToMeasure` - max rows to measure
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setTrackMouseOver

    public void setTrackMouseOver(boolean trackMouseOver)
                           throws java.lang.IllegalStateException

  True to highlight rows when the mouse is over. Default is true.

  Parameters:
    `trackMouseOver` - true to highlight rows when mouse over
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setEnableCtxMenu

    public void setEnableCtxMenu(boolean enableCtxMenu)
                          throws java.lang.IllegalStateException

  True to enable Grid context menus.

  Parameters:
    `enableCtxMenu` - true to enable context menu
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setEnableColumnResize

    public void setEnableColumnResize(boolean enableColumnResize)
                               throws java.lang.IllegalStateException

  True to enable column resize.

  Parameters:
    `enableColumnResize` - true to enable column resize
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setEnableDragDrop

    public void setEnableDragDrop(boolean enableDragDrop)
                           throws java.lang.IllegalStateException

  True to enable drag and drop of rows. Default is false.

  Parameters:
    `enableDragDrop` - true to enable drag drop of rows
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setEnableColumnMove

    public void setEnableColumnMove(boolean enableColumnMove)
                             throws java.lang.IllegalStateException

  True to enable drag and drop reorder of columns. Default is true.

  Parameters:
    `enableColumnMove` - true to enable column move
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setEnableColumnHide

    public void setEnableColumnHide(boolean enableColumnHide)
                             throws java.lang.IllegalStateException

  True to enable hiding of columns with the header context menu. Default is true

  Parameters:
    `enableColumnHide` - true to enable column hide
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setStripeRows

    public void setStripeRows(boolean stripeRows)
                       throws java.lang.IllegalStateException

  True to stripe the rows. Default is true.

  Parameters:
    `stripeRows` - true to stripe rows
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setSelectionModel

    public void setSelectionModel(AbstractSelectionModel selectionModel)
                           throws java.lang.IllegalStateException

  Set the GridPanel's selection model.

  Parameters:
    `selectionModel` - the selection model/
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setAutoHeight

    public void setAutoHeight(boolean autoHeight)
                       throws java.lang.IllegalStateException

  True to fit the height of the grid container to the height of the data. Default is false.

  Overrides:
    `setAutoHeight` in class `BoxComponent`
  Parameters:
    `autoHeight` - true to fit the height of the grid container to the height of the data
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setAutoExpandColumn

    public void setAutoExpandColumn(java.lang.String autoExpandColumn)
                             throws java.lang.IllegalStateException

  The id of a column in this grid that should expand to fill unused space. This id can not be 0. Default is false.
  Note : You must pass the ID of the ColumnConfig, and not the dataIndex of the corresponding ColumnConfig.

  Parameters:
    `autoExpandColumn` - the column id
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered
  See Also:
    `ColumnConfig.setId(String)`

### setAutoExpandColumn

    public void setAutoExpandColumn(int autoExpandColumn)
                             throws java.lang.IllegalStateException

  The id of a column in this grid that should expand to fill unused space. This id can not be 0. Default is false.

  Parameters:
    `autoExpandColumn` - the column id
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setAutoExpandMin

    public void setAutoExpandMin(int autoExpandMin)
                          throws java.lang.IllegalStateException

  The minimum width the autoExpandColumn can have (if enabled). Default is 50.

  Parameters:
    `autoExpandMin` - the min expand value
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setAutoExpandMax

    public void setAutoExpandMax(int autoExpandMax)
                          throws java.lang.IllegalStateException

  The maximum width the autoExpandColumn can have (if enabled). Default is 1000.

  Parameters:
    `autoExpandMax` - the max expand value
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setHideColumnHeader

    public void setHideColumnHeader(boolean hideColumnHeader)

  Hides the column header of the grid if passed true.

  Parameters:
    `hideColumnHeader` - true to hide the column headers

### setView

    public void setView(GridView view)
                 throws java.lang.IllegalStateException

  Sets the `GridView` used by the grid.

  Parameters:
    `view` - the grid view
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setLoadMask

    public void setLoadMask(boolean loadMask)
                     throws java.lang.IllegalStateException

  True to mask the grid while loading. Default is false.

  Parameters:
    `loadMask` - true to mask grid
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setLoadMask

    public void setLoadMask(java.lang.String message,
                            java.lang.String messageCls)
                     throws java.lang.IllegalStateException

  Sets the `LoadMask` to mask the grid while loading. Default is disable masking.

  Parameters:
    `message` - the load mask message
    `messageCls` - the load mask message CSS class
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setStore

    public void setStore(Store store)
                  throws java.lang.IllegalStateException

  The Store the grid should use as its data source (required).

  Parameters:
    `store` - the store
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### setColumnModel

    public void setColumnModel(ColumnModel columnModel)
                        throws java.lang.IllegalStateException

  The `ColumnModel` to use when rendering the grid (required).

  Parameters:
    `columnModel` - the grids column model
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

### stripeRows

    public void stripeRows(boolean stripeRows)
                    throws java.lang.IllegalStateException

  True to stripe the rows. Default is false.

  Parameters:
    `stripeRows` - true to stripe the rows. Default is false.
  Throws:
    `java.lang.IllegalStateException` - this property cannot be changed after the Component has been rendered

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD