|
|||||||||
| 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.extjs.gxt.ui.client.widget.Component
com.extjs.gxt.ui.client.widget.BoxComponent
com.extjs.gxt.ui.client.widget.grid.Grid<M>
M - the model typepublic class Grid<M extends ModelData>
This class represents the primary interface of a component 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.
setAutoExpandColumn(String).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).Component.setStateful(boolean). When the store uses a
PagingListLoader the offset and limit parameter are saved with
the Grid's state. These 2 values can be retrieved and used to make the first
load request to return the user to the same location they left the grid.
Code snippet:
PagingLoadConfig config = new BasePagingLoadConfig();
config.setOffset(0);
config.setLimit(50);
Map state = grid.getState();
if (state.containsKey("offset")) {
int offset = (Integer)state.get("offset");
int limit = (Integer)state.get("limit");
config.setOffset(offset);
config.setLimit(limit);
}
if (state.containsKey("sortField")) {
config.setSortField((String)state.get("sortField"));
config.setSortDir(SortDir.valueOf((String)state.get("sortDir")));
}
loader.load(config);
BaseEvent.setCancelled(boolean).
| Nested Class Summary |
|---|
| 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.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
Grid(ListStore<M> store,
ColumnModel cm)
Creates a new grid. |
|
| Method Summary | |
|---|---|
java.lang.String |
getAutoExpandColumn()
Returns the auto expand column id. |
int |
getAutoExpandMax()
Returns the auto expand maximum width. |
int |
getAutoExpandMin()
Returns the auto expand miniumum width. |
ColumnModel |
getColumnModel()
Returns the column model. |
int |
getLazyRowRender()
Returns the time in ms after the rows get rendered. |
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 |
getView()
Returns the grid's view. |
boolean |
isEnableColumnResize()
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 |
isStripeRows()
Returns true if row striping is enabled. |
boolean |
isTrackMouseOver()
Returns true if rows are highlighted on mouse over. |
boolean |
isViewReady()
Returns true if the view is ready. |
void |
onComponentEvent(ComponentEvent ce)
Any events a component receives will be forwarded to this method. |
void |
reconfigure(ListStore<M> store,
ColumnModel cm)
Reconfigures the grid to use a different Store and Column Model. |
void |
setAutoExpandColumn(java.lang.String autoExpandColumn)
The id of a column in this grid that should expand to fill unused space (pre-render). |
void |
setAutoExpandMax(int autoExpandMax)
The maximum width the autoExpandColumn can have (if enabled) (defaults to 1000, pre-render). |
void |
setAutoExpandMin(int autoExpandMin)
The minimum width the autoExpandColumn can have (if enabled)(pre-render). |
void |
setEnableColumnResize(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 |
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 |
setStringProvider(ModelStringProvider<M> stringProvider)
Sets the binder's string provider. |
void |
setStripeRows(boolean stripeRows)
True to stripe the rows (defaults to false). |
void |
setTrackMouseOver(boolean trackMouseOver)
True to highlight rows when the mouse is over (defaults to true). |
void |
setView(GridView view)
Sets the view's grid (pre-render). |
| Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent |
|---|
getBounds, getHeight, getHeight, getPosition, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, isAutoHeight, isAutoWidth, isDeferHeight, isShim, 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.google.gwt.user.client.ui.Widget |
|---|
fireEvent, getParent, isAttached |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, setStylePrimaryName, setVisible, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Grid(ListStore<M> store,
ColumnModel cm)
store - the data storecm - the column model| Method Detail |
|---|
public java.lang.String getAutoExpandColumn()
public int getAutoExpandMax()
public int getAutoExpandMin()
public ColumnModel getColumnModel()
public int getLazyRowRender()
public int getMinColumnWidth()
public GridSelectionModel<M> getSelectionModel()
public ListStore<M> getStore()
public GridView getView()
public boolean isEnableColumnResize()
public boolean isHideHeaders()
public boolean isLoadMask()
public boolean isStripeRows()
public boolean isTrackMouseOver()
public boolean isViewReady()
public void onComponentEvent(ComponentEvent ce)
ComponentComponent.onBrowserEvent(com.google.gwt.user.client.Event) method
should not be overridden or modified.
onComponentEvent in class Componentce - the base event
public void reconfigure(ListStore<M> store,
ColumnModel cm)
store - the new storecm - the new column modelpublic void setAutoExpandColumn(java.lang.String autoExpandColumn)
autoExpandColumn - the auto expand column idpublic void setAutoExpandMax(int autoExpandMax)
autoExpandMax - the auto expand maxpublic void setAutoExpandMin(int autoExpandMin)
autoExpandMin - the auto expand min widthpublic void setEnableColumnResize(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 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 setStringProvider(ModelStringProvider<M> stringProvider)
stringProvider - the string providerpublic void setStripeRows(boolean stripeRows)
stripeRows - true to strip rowspublic void setTrackMouseOver(boolean trackMouseOver)
trackMouseOver - true to highlight rows on mouse overpublic void setView(GridView view)
view - the view
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||