|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.sencha.gxt.widget.core.client.Component
com.sencha.gxt.widget.core.client.grid.Grid<M>
M - the model typepublic class Grid<M>
This class represents the primary interface of a widget based grid control.
The grid requires a ListStore and ColumnModel when
constructed. Each model in the store will be rendered as a row in the grid.
Any updates to the store are automatically pushed to the grid. This includes
inserting, removing, sorting and filter.
GridView.setAutoExpandColumn(ColumnConfig).GridView.setAutoFill(boolean) to
enable this feature. With auto fill, the calculations are only run once.
After the grid is rendered, the columns widths will not be adjusted when
available width changes. You can use @link
GridView.setForceFit(boolean) to always run the width calculations on
any changes to available width or column sizes. Columns can be "fixed" which
prevents their columns widths to be adjusted by the grid "weight"
calculations. See @link ColumnConfig.setFixed(boolean).
| Nested Class Summary | |
|---|---|
static interface |
Grid.Callback
Provides a mechanism by which other components can report whether a cell is selectable. |
static class |
Grid.GridCell
A reference to a cell in the grid that can be used for a variety of purposes, including, for example, whether it is active or selected. |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Grid(ListStore<M> store,
ColumnModel<M> cm)
Creates a new grid with the given data store and column model. |
|
Grid(ListStore<M> store,
ColumnModel<M> cm,
GridView<M> view)
Creates a new grid with the given data store and column model. |
|
| Method Summary | |
|---|---|
HandlerRegistration |
addBodyScrollHandler(BodyScrollEvent.BodyScrollHandler handler)
|
HandlerRegistration |
addCellClickHandler(CellClickEvent.CellClickHandler handler)
|
HandlerRegistration |
addCellDoubleClickHandler(CellDoubleClickEvent.CellDoubleClickHandler handler)
|
HandlerRegistration |
addCellMouseDownHandler(CellMouseDownEvent.CellMouseDownHandler handler)
|
HandlerRegistration |
addHeaderClickHandler(HeaderClickEvent.HeaderClickHandler handler)
|
HandlerRegistration |
addHeaderContextMenuHandler(HeaderContextMenuEvent.HeaderContextMenuHandler handler)
|
HandlerRegistration |
addHeaderDoubleClickHandler(HeaderDoubleClickEvent.HeaderDoubleClickHandler handler)
|
HandlerRegistration |
addHeaderMouseDownHandler(HeaderMouseDownEvent.HeaderMouseDownHandler handler)
|
HandlerRegistration |
addReconfigureHandler(ReconfigureEvent.ReconfigureHandler handler)
|
HandlerRegistration |
addRefreshHandler(RefreshEvent.RefreshHandler handler)
Adds a RefreshEvent.RefreshHandler handler for
RefreshEvent events. |
HandlerRegistration |
addRowClickHandler(RowClickEvent.RowClickHandler handler)
|
HandlerRegistration |
addRowDoubleClickHandler(RowDoubleClickEvent.RowDoubleClickHandler handler)
|
HandlerRegistration |
addRowMouseDownHandler(RowMouseDownEvent.RowMouseDownHandler handler)
|
HandlerRegistration |
addSortChangeHandler(SortChangeEvent.SortChangeHandler handler)
|
HandlerRegistration |
addViewReadyHandler(ViewReadyEvent.ViewReadyHandler handler)
|
ColumnModel<M> |
getColumnModel()
Returns the column model. |
int |
getLazyRowRender()
Returns the time in ms after the rows get rendered. |
ListLoader<?,?> |
getLoader()
Returns the loader. |
int |
getMinColumnWidth()
Returns the minimum column width. |
GridSelectionModel<M> |
getSelectionModel()
Returns the grid's selection model. |
ListStore<M> |
getStore()
Returns the grid's store. |
GridView<M> |
getView()
Returns the grid's view. |
boolean |
isColumnReordering()
Returns true if column reordering is enabled. |
boolean |
isColumnResize()
Returns true if column resizing is enabled. |
boolean |
isHideHeaders()
Returns true if the header is hidden. |
boolean |
isLoadMask()
Returns true if the load mask in enabled. |
boolean |
isViewReady()
Returns true if the view is ready. |
void |
onBrowserEvent(Event ce)
|
void |
reconfigure(ListStore<M> store,
ColumnModel<M> cm)
Reconfigures the grid to use a different Store and Column Model. |
void |
setAllowTextSelection(boolean enable)
Enables and disables text selection for the widget. |
void |
setColumnReordering(boolean enableColumnReorder)
True to enable column reordering via drag and drop (defaults to false). |
void |
setColumnResize(boolean enableColumnResize)
Sets whether columns may be resized (defaults to true). |
void |
setHideHeaders(boolean hideHeaders)
Sets whether the header should be hidden (defaults to false). |
void |
setLazyRowRender(int lazyRowRender)
Sets the time in ms after the row gets rendered (defaults to 10). |
void |
setLoader(ListLoader<?,?> loader)
Sets the loader. |
void |
setLoadMask(boolean loadMask)
Sets whether a load mask should be displayed during load operations (defaults to false). |
void |
setMinColumnWidth(int minColumnWidth)
The minimum width a column can be resized to (defaults to 25). |
void |
setSelectionModel(GridSelectionModel<M> sm)
Sets the grid selection model. |
void |
setView(GridView<M> view)
Sets the view's grid (pre-render). |
Grid.GridCell |
walkCells(int row,
int col,
int step,
Grid.Callback callback)
Navigate in the requested direction to the next selectable cell, given the row, column and step. |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
@UiConstructor
public Grid(ListStore<M> store,
ColumnModel<M> cm,
GridView<M> view)
store - the data storecm - the column model
public Grid(ListStore<M> store,
ColumnModel<M> cm)
store - the data storecm - the column model| Method Detail |
|---|
public HandlerRegistration addBodyScrollHandler(BodyScrollEvent.BodyScrollHandler handler)
addBodyScrollHandler in interface BodyScrollEvent.HasBodyScrollHandlerspublic HandlerRegistration addCellClickHandler(CellClickEvent.CellClickHandler handler)
addCellClickHandler in interface CellClickEvent.HasCellClickHandlerspublic HandlerRegistration addCellDoubleClickHandler(CellDoubleClickEvent.CellDoubleClickHandler handler)
addCellDoubleClickHandler in interface CellDoubleClickEvent.HasCellDoubleClickHandlerspublic HandlerRegistration addCellMouseDownHandler(CellMouseDownEvent.CellMouseDownHandler handler)
addCellMouseDownHandler in interface CellMouseDownEvent.HasCellMouseDownHandlerspublic HandlerRegistration addHeaderClickHandler(HeaderClickEvent.HeaderClickHandler handler)
addHeaderClickHandler in interface HeaderClickEvent.HasHeaderClickHandlerspublic HandlerRegistration addHeaderContextMenuHandler(HeaderContextMenuEvent.HeaderContextMenuHandler handler)
addHeaderContextMenuHandler in interface HeaderContextMenuEvent.HasHeaderContextMenuHandlerspublic HandlerRegistration addHeaderDoubleClickHandler(HeaderDoubleClickEvent.HeaderDoubleClickHandler handler)
addHeaderDoubleClickHandler in interface HeaderDoubleClickEvent.HasHeaderDoubleClickHandlerspublic HandlerRegistration addHeaderMouseDownHandler(HeaderMouseDownEvent.HeaderMouseDownHandler handler)
addHeaderMouseDownHandler in interface HeaderMouseDownEvent.HasHeaderMouseDownHandlerspublic HandlerRegistration addReconfigureHandler(ReconfigureEvent.ReconfigureHandler handler)
addReconfigureHandler in interface ReconfigureEvent.HasReconfigureHandlerspublic HandlerRegistration addRefreshHandler(RefreshEvent.RefreshHandler handler)
RefreshEvent.HasRefreshHandlersRefreshEvent.RefreshHandler handler for
RefreshEvent events.
addRefreshHandler in interface RefreshEvent.HasRefreshHandlershandler - the handler
public HandlerRegistration addRowClickHandler(RowClickEvent.RowClickHandler handler)
addRowClickHandler in interface RowClickEvent.HasRowClickHandlerspublic HandlerRegistration addRowDoubleClickHandler(RowDoubleClickEvent.RowDoubleClickHandler handler)
addRowDoubleClickHandler in interface RowDoubleClickEvent.HasRowDoubleClickHandlerspublic HandlerRegistration addRowMouseDownHandler(RowMouseDownEvent.RowMouseDownHandler handler)
addRowMouseDownHandler in interface RowMouseDownEvent.HasRowMouseDownHandlerspublic HandlerRegistration addSortChangeHandler(SortChangeEvent.SortChangeHandler handler)
addSortChangeHandler in interface SortChangeEvent.HasSortChangeHandlerspublic HandlerRegistration addViewReadyHandler(ViewReadyEvent.ViewReadyHandler handler)
addViewReadyHandler in interface ViewReadyEvent.HasViewReadyHandlerspublic ColumnModel<M> getColumnModel()
public int getLazyRowRender()
public ListLoader<?,?> getLoader()
public int getMinColumnWidth()
public GridSelectionModel<M> getSelectionModel()
public ListStore<M> getStore()
public GridView<M> getView()
public boolean isColumnReordering()
public boolean isColumnResize()
public boolean isHideHeaders()
public boolean isLoadMask()
public boolean isViewReady()
public void onBrowserEvent(Event ce)
onBrowserEvent in interface EventListeneronBrowserEvent in class Component
public void reconfigure(ListStore<M> store,
ColumnModel<M> cm)
store - the new storecm - the new column modelpublic void setAllowTextSelection(boolean enable)
Component
setAllowTextSelection in class Componentenable - true to enable, false to disablepublic void setColumnReordering(boolean enableColumnReorder)
enableColumnReorder - true to enablepublic void setColumnResize(boolean enableColumnResize)
enableColumnResize - true to allow column resizingpublic void setHideHeaders(boolean hideHeaders)
hideHeaders - true to hide the headerpublic void setLazyRowRender(int lazyRowRender)
lazyRowRender - the time in ms after the rows get rendered.public void setLoader(ListLoader<?,?> loader)
loader - the loaderpublic void setLoadMask(boolean loadMask)
loadMask - true to show a maskpublic void setMinColumnWidth(int minColumnWidth)
minColumnWidth - the min column widthpublic void setSelectionModel(GridSelectionModel<M> sm)
sm - the selection modelpublic void setView(GridView<M> view)
view - the view
public Grid.GridCell walkCells(int row,
int col,
int step,
Grid.Callback callback)
row - the starting row indexcol - the starting column indexstep - the step size and directioncallback - a callback that determines whether the given cell is
selectable
null if no cell matches the criteria
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||