com.extjs.gxt.ui.client.widget.grid
Class EditorGrid<M extends ModelData>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.grid.Grid<M>
                      extended by com.extjs.gxt.ui.client.widget.grid.EditorGrid<M>
All Implemented Interfaces:
Observable, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget

public class EditorGrid<M extends ModelData>
extends Grid<M>

Adds editing capabilities to Grid.

Events:
BeforeEdit : GridEvent(grid, record, property, value, rowIndex, colIndex)
Fires before cell editing is triggered. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
AfterEdit : GridEvent(grid, record, property, value, startValue, rowIndex, colIndex)
Fires after a cell is edited.
ValidateEdit : GridEvent(grid, record, property, value, startValue, rowIndex, colIndex)
Fires right before the record is updated. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).


Nested Class Summary
static class EditorGrid.ClicksToEdit
          ClicksToEdit enumeration.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.extjs.gxt.ui.client.widget.grid.Grid
cm, editSupport, sm, store, stringProvider, view, viewReady
 
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Component
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
EditorGrid(ListStore store, ColumnModel cm)
          Creates a new editor grid.
 
Method Summary
 CellEditor getActiveEditor()
          Returns the active editor.
 EditorGrid.ClicksToEdit getClicksToEdit()
          Returns the clicks to edit.
 boolean isEditing()
          Returns true if editing is active.
protected  void onDoubleClick(GridEvent<M> e)
           
protected  void onRender(com.google.gwt.user.client.Element target, int index)
          Subclasses must override and ensure setElement is called for lazy rendered components.
 void reconfigure(ListStore<M> store, ColumnModel cm)
          Reconfigures the grid to use a different Store and Column Model.
 void setClicksToEdit(EditorGrid.ClicksToEdit clicksToEdit)
          Sets the number of clicks to edit (defaults to ONE).
 void startEditing(int row, int col)
          Starts editing the specified for the specified row/column.
 void stopEditing()
          Stops any active editing.
 void stopEditing(boolean cancel)
          Stops any active editing.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.grid.Grid
afterRender, afterRenderView, applyState, createComponentEvent, disableTextSelection, doApplyStoreState, doAttachChildren, doDetachChildren, getAutoExpandColumn, getAutoExpandMax, getAutoExpandMin, getColumnModel, getEditSupport, getFocusEl, getLazyRowRender, getMinColumnWidth, getModelProcessor, getSelectionModel, getStore, getView, isColumnLines, isColumnReordering, isColumnResize, isHideHeaders, isLoadMask, isStripeRows, isTrackMouseOver, isViewReady, notifyHide, notifyShow, onAfterRenderView, onBlur, onClick, onComponentEvent, onDisable, onEnable, onFocus, onMouseDown, onMouseUp, onResize, setAriaRole, setAriaState, setAutoExpandColumn, setAutoExpandMax, setAutoExpandMin, setColumnLines, setColumnReordering, setColumnResize, setHideHeaders, setLazyRowRender, setLoadMask, setMinColumnWidth, setModelProcessor, setSelectionModel, setStringProvider, setStripeRows, setTrackMouseOver, setView, walkCells
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustPosition, adjustSize, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onHide, onPosition, onShow, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addAttachable, addListener, addPlugin, addStyleName, addStyleOnOver, addWidgetListener, assertAfterRender, assertPreRender, beforeRender, blur, clearState, createObservable, createStyles, disable, disableContextMenu, disableEvents, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, frame, getAriaSupport, getBaseStyle, getBorders, getContextMenu, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getListeners, getModel, getObservable, getPlugins, getState, getStateId, getTabIndex, getTitle, getToolTip, getWindowResizeDelay, hasListeners, hasListeners, hide, hideToolTip, initState, isDisabledEvents, isDisableTextSelection, isEnabled, isMasked, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, mask, onAttach, onBrowserEvent, onDetach, onDetachHelper, onEnsureDebugId, onHideContextMenu, onLoad, onRightClick, onShowContextMenu, onWindowResize, previewEvent, recalculate, removeAllListeners, removeAttachagle, removeFromParent, removeListener, removeStyleName, removeStyleOnOver, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setAriaSupport, setBorders, setContextMenu, setData, setEl, setElement, setElement, setEnabled, setFiresEvents, setHideMode, setId, setIntStyleAttribute, setItemId, setModel, setMonitorWindowResize, setParent, setStateful, setStateId, setStyleAttribute, setStyleName, setTabIndex, setTitle, setToolTip, setToolTip, setVisible, setWindowResizeDelay, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unframe, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EditorGrid

public EditorGrid(ListStore store,
                  ColumnModel cm)
Creates a new editor grid.

Parameters:
store - the store
cm - the column model
Method Detail

getActiveEditor

public CellEditor getActiveEditor()
Returns the active editor.

Returns:
the active editor

getClicksToEdit

public EditorGrid.ClicksToEdit getClicksToEdit()
Returns the clicks to edit.

Returns:
the clicks to edit

isEditing

public boolean isEditing()
Returns true if editing is active.

Returns:
the editing state

reconfigure

public void reconfigure(ListStore<M> store,
                        ColumnModel cm)
Description copied from class: Grid
Reconfigures the grid to use a different Store and Column Model. The View will be bound to the new objects and refreshed.

Overrides:
reconfigure in class Grid<M extends ModelData>
Parameters:
store - the new store
cm - the new column model

setClicksToEdit

public void setClicksToEdit(EditorGrid.ClicksToEdit clicksToEdit)
Sets the number of clicks to edit (defaults to ONE).

Parameters:
clicksToEdit - the clicks to edit

startEditing

public void startEditing(int row,
                         int col)
Starts editing the specified for the specified row/column.

Parameters:
row - the row index
col - the column index

stopEditing

public void stopEditing()
Stops any active editing.


stopEditing

public void stopEditing(boolean cancel)
Stops any active editing.

Parameters:
cancel - true to cancel, false to complete

onDoubleClick

protected void onDoubleClick(GridEvent<M> e)
Overrides:
onDoubleClick in class Grid<M extends ModelData>

onRender

protected void onRender(com.google.gwt.user.client.Element target,
                        int index)
Description copied from class: Component
Subclasses must override and ensure setElement is called for lazy rendered components.

Overrides:
onRender in class Grid<M extends ModelData>
Parameters:
target - the target element
index - the insert location