|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.extjs.gxt.ui.client.event.BaseObservable
com.extjs.gxt.ui.client.widget.grid.GridView
public class GridView
This class encapsulates the user interface of an Grid
. Methods of
this class may be used to access user interface elements to enable special
display effects. Do not change the DOM structure of the user interface.
ListStore
.
Nested Class Summary | |
---|---|
class |
GridView.GridViewImages
Icons used by Grid which can be overridden as needed. |
Field Summary | |
---|---|
protected int |
activeHdIndex
|
protected boolean |
autoFill
|
protected int |
borderWidth
|
protected ColumnModel |
cm
|
protected Listener<ColumnModelEvent> |
columnListener
|
protected boolean |
deferEmptyText
|
protected ListStore<ModelData> |
ds
|
protected El |
el
|
protected java.lang.String |
emptyText
|
protected boolean |
enableHdMenu
|
protected boolean |
enableRowBody
|
protected El |
focusEl
|
protected boolean |
focusEnabled
|
protected ColumnFooter |
footer
|
protected boolean |
forceFit
|
protected Grid<ModelData> |
grid
|
protected ColumnHeader |
header
|
protected int |
headerColumnIndex
|
protected boolean |
headerDisabled
|
protected GridView.GridViewImages |
images
|
protected El |
innerHd
|
protected int |
lastViewWidth
|
protected StoreListener<ModelData> |
listener
|
protected El |
mainBody
|
protected El |
mainHd
|
protected El |
mainWrap
|
protected com.google.gwt.dom.client.Element |
overRow
|
protected boolean |
preventScrollToTopOnRefresh
|
protected El |
scroller
|
protected int |
scrollOffset
|
protected boolean |
selectable
|
protected SortInfo |
sortState
|
protected int |
splitterWidth
|
protected GridTemplates |
templates
|
protected boolean |
userResized
|
protected boolean |
vbar
|
protected GridViewConfig |
viewConfig
|
protected java.util.List<java.util.List<com.google.gwt.user.client.ui.Widget>> |
widgetList
|
Constructor Summary | |
---|---|
GridView()
|
Method Summary | |
---|---|
protected void |
addRowStyle(com.google.gwt.dom.client.Element elem,
java.lang.String style)
|
protected void |
afterRender()
|
protected void |
applyEmptyText()
|
protected void |
autoExpand(boolean preventUpdate)
|
protected void |
calculateVBar(boolean force)
|
protected GridEvent<?> |
createComponentEvent(com.google.gwt.user.client.Event event)
|
protected Menu |
createContextMenu(int colIndex)
|
protected void |
detachWidget(int rowIndex,
boolean remove)
|
protected void |
detachWidgets(int startRow,
int endRow,
boolean remove)
|
protected void |
doAttach()
|
protected void |
doDetach()
|
protected java.lang.String |
doRender(java.util.List<ColumnData> cs,
java.util.List<ModelData> rows,
int startRow,
int colCount,
boolean stripe)
|
protected void |
doSort(int colIndex,
Style.SortDir sortDir)
|
Point |
ensureVisible(int row,
int col,
boolean hscroll)
Ensured the current row and column is visible. |
com.google.gwt.dom.client.Element |
findCell(com.google.gwt.dom.client.Element elem)
Returns the cell. |
int |
findCellIndex(com.google.gwt.dom.client.Element elem,
java.lang.String requiredStyle)
Returns the cell index. |
com.google.gwt.dom.client.Element |
findRow(com.google.gwt.dom.client.Element el)
Returns the row element. |
int |
findRowIndex(com.google.gwt.dom.client.Element elem)
Returns the row index. |
protected void |
fitColumns(boolean preventRefresh,
boolean onlyExpand,
int omitColumn)
|
protected El |
fly(com.google.gwt.dom.client.Element elem)
|
void |
focusCell(int rowIndex,
int colIndex,
boolean hscroll)
Focus the cell and scrolls into view. |
protected void |
focusGrid()
|
void |
focusRow(int rowIndex)
Focus the row and scrolls into view. |
El |
getBody()
Returns the grid's body element. |
com.google.gwt.dom.client.Element |
getCell(int row,
int col)
Returns the grid's <TD> HtmlElement at the specified coordinates. |
protected int |
getCellIndex(com.google.gwt.dom.client.Element elem)
|
int |
getCellSelectorDepth()
Returns the cell selector depth. |
protected java.util.List<ColumnData> |
getColumnData()
|
protected java.lang.String |
getColumnStyle(int colIndex,
boolean isHeader)
|
protected int |
getColumnWidth(int col)
|
com.google.gwt.dom.client.Element |
getEditorParent()
Returns the editor parent element. |
java.lang.String |
getEmptyText()
Returns the empty text. |
ColumnHeader |
getHeader()
Returns the grid's column header. |
com.google.gwt.dom.client.Element |
getHeaderCell(int index)
Returns the <TD> HtmlElement which represents the Grid's header cell for the specified column index. |
GridView.GridViewImages |
getImages()
Returns the images used by grid. |
protected int |
getOffsetWidth()
|
protected java.lang.String |
getRenderedValue(ColumnData data,
int rowIndex,
int colIndex,
ModelData m,
java.lang.String property)
|
com.google.gwt.dom.client.Element |
getRow(int row)
Return the <TR> HtmlElement which represents a Grid row for the specified index. |
com.google.gwt.dom.client.Element |
getRow(ModelData m)
Return the <TR> HtmlElement which represents a Grid row for the specified model. |
protected com.google.gwt.dom.client.NodeList<com.google.gwt.dom.client.Element> |
getRows()
|
int |
getRowSelectorDepth()
Returns the row selector depth. |
protected int |
getScrollAdjust()
|
El |
getScroller()
Returns the scroll element. |
Point |
getScrollState()
Returns the current scroll state. |
protected SortInfo |
getSortState()
|
protected int |
getTotalWidth()
|
GridViewConfig |
getViewConfig()
Returns the view config. |
com.google.gwt.user.client.ui.Widget |
getWidget(int rowIndex,
int colIndex)
Returns the widget at the current location. |
protected com.google.gwt.dom.client.Element |
getWidgetCell(int row,
int cell)
|
protected void |
handleComponentEvent(GridEvent ge)
|
protected boolean |
hasRows()
|
protected void |
init(Grid grid)
Initializes the view. |
protected void |
initData(ListStore ds,
ColumnModel cm)
Initializes the data. |
protected void |
initElements()
|
protected void |
initListeners()
|
protected void |
initTemplates()
|
protected void |
initUI(Grid<ModelData> grid)
|
protected void |
insertRows(ListStore<ModelData> store,
int firstRow,
int lastRow,
boolean isUpdate)
|
boolean |
isAdjustForHScroll()
Returns true if the grid width will be adjusted based on visibility of horizontal scroll bar. |
boolean |
isAutoFill()
Returns true if auto fill is enabled. |
boolean |
isForceFit()
Returns true if force fit is enabled. |
boolean |
isShowDirtyCells()
Returns true if dirty cell markers are enabled. |
boolean |
isShowInvalidCells()
Returns true if invalid cell markers are enabled. |
boolean |
isSortingEnabled()
Returns true if sorting is enabled. |
void |
layout()
|
protected void |
layout(boolean skipResize)
|
protected ColumnHeader |
newColumnHeader()
|
protected void |
notifyHide()
|
protected void |
notifyShow()
|
protected void |
onAdd(ListStore<ModelData> store,
java.util.List<ModelData> models,
int index)
|
protected void |
onBeforeDataChanged(StoreEvent<ModelData> se)
|
protected void |
onCellDeselect(int row,
int col)
|
protected void |
onCellSelect(int row,
int col)
|
protected void |
onClear(StoreEvent<ModelData> se)
|
protected void |
onClick(GridEvent<ModelData> ce)
|
protected void |
onColumnMove(int newIndex)
|
protected void |
onColumnSplitterMoved(int colIndex,
int width)
|
protected void |
onColumnWidthChange(int column,
int width)
|
protected void |
onDataChanged(StoreEvent<ModelData> se)
|
protected void |
onHeaderChange(int column,
java.lang.String text)
|
protected void |
onHeaderClick(Grid<ModelData> grid,
int column)
|
protected void |
onHiddenChange(ColumnModel cm,
int col,
boolean hidden)
|
protected void |
onHighlightRow(int rowIndex,
boolean highlight)
|
protected void |
onMouseDown(GridEvent<ModelData> ge)
|
protected void |
onRemove(ListStore<ModelData> ds,
ModelData m,
int index,
boolean isUpdate)
|
protected void |
onRowDeselect(int rowIndex)
|
protected void |
onRowOut(com.google.gwt.dom.client.Element row)
|
protected void |
onRowOver(com.google.gwt.dom.client.Element row)
|
protected void |
onRowSelect(int rowIndex)
|
protected void |
onUpdate(ListStore<ModelData> store,
ModelData model)
|
protected ModelData |
prepareData(ModelData model)
|
protected void |
processRows(int startRow,
boolean skipStripe)
|
void |
refresh(boolean headerToo)
Rebuilds the grid using its current configuration and data. |
protected void |
refreshRow(int row)
|
protected void |
removeRow(int row)
|
protected void |
removeRowStyle(com.google.gwt.dom.client.Element row,
java.lang.String style)
|
protected void |
render()
|
protected void |
renderFooter()
|
protected void |
renderHeader()
|
protected java.lang.String |
renderRows(int startRow,
int endRow)
|
protected void |
renderUI()
|
protected void |
renderWidgets(int startRow,
int endRow)
|
protected void |
resize()
|
protected void |
restoreScroll(Point state)
|
void |
scrollToTop()
Scrolls the grid to the top. |
void |
setAdjustForHScroll(boolean adjustForHScroll)
True to adjust the grid width when the horizontal scrollbar is hidden and visible (defaults to true). |
void |
setAutoFill(boolean autoFill)
True to auto expand the columns to fit the grid when the grid is created. |
void |
setCellSelectorDepth(int cellSelectorDepth)
The number of levels to search for cells in event delegation (defaults to 4). |
void |
setEmptyText(java.lang.String emptyText)
Default text to display in the grid body when no rows are available (defaults to ''). |
void |
setForceFit(boolean forceFit)
True to auto expand/contract the size of the columns to fit the grid width and prevent horizontal scrolling. |
void |
setRowSelectorDepth(int rowSelectorDepth)
The number of levels to search for rows in event delegation (defaults to 10). |
void |
setShowDirtyCells(boolean showDirtyCells)
True to display a red triangle in the upper left corner of any cells which are "dirty" as defined by any existing records in the data store (defaults to true). |
void |
setShowInvalidCells(boolean showInvalidCells)
True to enabled invalid cell markers (defaults to false). |
void |
setSortingEnabled(boolean sortable)
True to allow column sorting when the user clicks a column (defaults to true). |
void |
setViewConfig(GridViewConfig viewConfig)
Sets the view config. |
protected void |
stopEditing()
|
protected void |
syncHeaderScroll()
|
protected void |
syncHScroll()
|
protected void |
syncScroll()
|
protected void |
templateAfterMove(int index)
|
protected void |
templateOnAllColumnWidthsUpdated(java.util.List<java.lang.Integer> ws,
int tw)
|
protected void |
templateOnColumnHiddenUpdated(int col,
boolean hidden,
int tw)
|
protected void |
templateOnColumnWidthUpdated(int col,
int w,
int tw)
|
protected void |
templateOnLayout(int vw,
int vh)
|
protected void |
templateUpdateColumnText(int col,
java.lang.String text)
|
protected void |
updateAllColumnWidths()
|
protected void |
updateColumnHidden(int index,
boolean hidden)
|
protected void |
updateColumnWidth(int col,
int width)
|
protected void |
updateHeaderSortState()
|
protected void |
updateSortIcon(int colIndex,
Style.SortDir dir)
|
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 |
---|
protected int activeHdIndex
protected boolean autoFill
protected int borderWidth
protected ColumnModel cm
protected Listener<ColumnModelEvent> columnListener
protected boolean deferEmptyText
protected ListStore<ModelData> ds
protected El el
protected El mainWrap
protected El mainHd
protected El innerHd
protected El scroller
protected El mainBody
protected El focusEl
protected java.lang.String emptyText
protected boolean enableHdMenu
protected boolean enableRowBody
protected boolean focusEnabled
protected ColumnFooter footer
protected boolean forceFit
protected Grid<ModelData> grid
protected ColumnHeader header
protected int headerColumnIndex
protected boolean headerDisabled
protected GridView.GridViewImages images
protected int lastViewWidth
protected StoreListener<ModelData> listener
protected com.google.gwt.dom.client.Element overRow
protected boolean preventScrollToTopOnRefresh
protected int scrollOffset
protected boolean selectable
protected SortInfo sortState
protected int splitterWidth
protected GridTemplates templates
protected boolean userResized
protected boolean vbar
protected GridViewConfig viewConfig
protected java.util.List<java.util.List<com.google.gwt.user.client.ui.Widget>> widgetList
Constructor Detail |
---|
public GridView()
Method Detail |
---|
public Point ensureVisible(int row, int col, boolean hscroll)
row
- the row indexcol
- the column indexhscroll
- true to scroll horizontally if needed
public com.google.gwt.dom.client.Element findCell(com.google.gwt.dom.client.Element elem)
elem
- the cell element or a child element
public int findCellIndex(com.google.gwt.dom.client.Element elem, java.lang.String requiredStyle)
elem
- the cell or child elementrequiredStyle
- an optional required style name
public com.google.gwt.dom.client.Element findRow(com.google.gwt.dom.client.Element el)
el
- the row element or any child element
public int findRowIndex(com.google.gwt.dom.client.Element elem)
elem
- the row or child of the row element
public void focusCell(int rowIndex, int colIndex, boolean hscroll)
rowIndex
- the row indexcolIndex
- the column indexhscroll
- true to scroll horizontallypublic void focusRow(int rowIndex)
rowIndex
- the row indexpublic El getBody()
public com.google.gwt.dom.client.Element getCell(int row, int col)
row
- the row index in which to find the cellcol
- the column index of the cell
public int getCellSelectorDepth()
public com.google.gwt.dom.client.Element getEditorParent()
public java.lang.String getEmptyText()
public ColumnHeader getHeader()
public com.google.gwt.dom.client.Element getHeaderCell(int index)
index
- the column index
public GridView.GridViewImages getImages()
public com.google.gwt.dom.client.Element getRow(int row)
row
- the row index
public com.google.gwt.dom.client.Element getRow(ModelData m)
m
- the model
public int getRowSelectorDepth()
public El getScroller()
public Point getScrollState()
public GridViewConfig getViewConfig()
public com.google.gwt.user.client.ui.Widget getWidget(int rowIndex, int colIndex)
rowIndex
- the row indexcolIndex
- the column index
public boolean isAdjustForHScroll()
public boolean isAutoFill()
public boolean isForceFit()
public boolean isShowDirtyCells()
public boolean isShowInvalidCells()
public boolean isSortingEnabled()
public void layout()
public void refresh(boolean headerToo)
headerToo
- true to refresh the headerpublic void scrollToTop()
public void setAdjustForHScroll(boolean adjustForHScroll)
adjustForHScroll
- true to adjust for horizontal scroll barpublic void setAutoFill(boolean autoFill)
autoFill
- true to expandpublic void setCellSelectorDepth(int cellSelectorDepth)
cellSelectorDepth
- the cell selector depthpublic void setEmptyText(java.lang.String emptyText)
emptyText
- the empty textpublic void setForceFit(boolean forceFit)
forceFit
- true to force fitpublic void setRowSelectorDepth(int rowSelectorDepth)
rowSelectorDepth
- the row selector depthpublic void setShowDirtyCells(boolean showDirtyCells)
showDirtyCells
- true to display the dirty flagpublic void setShowInvalidCells(boolean showInvalidCells)
showInvalidCells
- true to enablepublic void setSortingEnabled(boolean sortable)
sortable
- true for sortable columnspublic void setViewConfig(GridViewConfig viewConfig)
viewConfig
- the view configprotected void addRowStyle(com.google.gwt.dom.client.Element elem, java.lang.String style)
protected void afterRender()
protected void applyEmptyText()
protected void autoExpand(boolean preventUpdate)
protected void calculateVBar(boolean force)
protected GridEvent<?> createComponentEvent(com.google.gwt.user.client.Event event)
protected Menu createContextMenu(int colIndex)
protected void detachWidget(int rowIndex, boolean remove)
protected void detachWidgets(int startRow, int endRow, boolean remove)
protected void doAttach()
protected void doDetach()
protected java.lang.String doRender(java.util.List<ColumnData> cs, java.util.List<ModelData> rows, int startRow, int colCount, boolean stripe)
protected void doSort(int colIndex, Style.SortDir sortDir)
protected void fitColumns(boolean preventRefresh, boolean onlyExpand, int omitColumn)
protected El fly(com.google.gwt.dom.client.Element elem)
protected void focusGrid()
protected int getCellIndex(com.google.gwt.dom.client.Element elem)
protected java.util.List<ColumnData> getColumnData()
protected java.lang.String getColumnStyle(int colIndex, boolean isHeader)
protected int getColumnWidth(int col)
protected int getOffsetWidth()
protected java.lang.String getRenderedValue(ColumnData data, int rowIndex, int colIndex, ModelData m, java.lang.String property)
protected com.google.gwt.dom.client.NodeList<com.google.gwt.dom.client.Element> getRows()
protected int getScrollAdjust()
protected SortInfo getSortState()
protected int getTotalWidth()
protected com.google.gwt.dom.client.Element getWidgetCell(int row, int cell)
protected void handleComponentEvent(GridEvent ge)
protected boolean hasRows()
protected void init(Grid grid)
grid
- the gridprotected void initData(ListStore ds, ColumnModel cm)
ds
- the data storecm
- the column modelprotected void initElements()
protected void initListeners()
protected void initTemplates()
protected void initUI(Grid<ModelData> grid)
protected void insertRows(ListStore<ModelData> store, int firstRow, int lastRow, boolean isUpdate)
protected void layout(boolean skipResize)
protected ColumnHeader newColumnHeader()
protected void notifyHide()
protected void notifyShow()
protected void onAdd(ListStore<ModelData> store, java.util.List<ModelData> models, int index)
protected void onBeforeDataChanged(StoreEvent<ModelData> se)
protected void onCellDeselect(int row, int col)
protected void onCellSelect(int row, int col)
protected void onClear(StoreEvent<ModelData> se)
protected void onClick(GridEvent<ModelData> ce)
protected void onColumnMove(int newIndex)
protected void onColumnSplitterMoved(int colIndex, int width)
protected void onColumnWidthChange(int column, int width)
protected void onDataChanged(StoreEvent<ModelData> se)
protected void onHeaderChange(int column, java.lang.String text)
protected void onHeaderClick(Grid<ModelData> grid, int column)
protected void onHiddenChange(ColumnModel cm, int col, boolean hidden)
protected void onHighlightRow(int rowIndex, boolean highlight)
protected void onMouseDown(GridEvent<ModelData> ge)
protected void onRemove(ListStore<ModelData> ds, ModelData m, int index, boolean isUpdate)
protected void onRowDeselect(int rowIndex)
protected void onRowOut(com.google.gwt.dom.client.Element row)
protected void onRowOver(com.google.gwt.dom.client.Element row)
protected void onRowSelect(int rowIndex)
protected void onUpdate(ListStore<ModelData> store, ModelData model)
protected ModelData prepareData(ModelData model)
protected void processRows(int startRow, boolean skipStripe)
protected void refreshRow(int row)
protected void removeRow(int row)
protected void removeRowStyle(com.google.gwt.dom.client.Element row, java.lang.String style)
protected void render()
protected void renderFooter()
protected void renderHeader()
protected java.lang.String renderRows(int startRow, int endRow)
protected void renderUI()
protected void renderWidgets(int startRow, int endRow)
protected void resize()
protected void restoreScroll(Point state)
protected void stopEditing()
protected void syncHeaderScroll()
protected void syncHScroll()
protected void syncScroll()
protected void templateAfterMove(int index)
protected void templateOnAllColumnWidthsUpdated(java.util.List<java.lang.Integer> ws, int tw)
protected void templateOnColumnHiddenUpdated(int col, boolean hidden, int tw)
protected void templateOnColumnWidthUpdated(int col, int w, int tw)
protected void templateOnLayout(int vw, int vh)
protected void templateUpdateColumnText(int col, java.lang.String text)
protected void updateAllColumnWidths()
protected void updateColumnHidden(int index, boolean hidden)
protected void updateColumnWidth(int col, int width)
protected void updateHeaderSortState()
protected void updateSortIcon(int colIndex, Style.SortDir dir)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |