public class GridView<M> extends Object
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.
This class does not provide ways to manipulate the underlying data. The data model of a Grid is held in a
ListStore
.
Modifier and Type | Class and Description |
---|---|
static interface |
GridView.GridAppearance
Define the appearance of a Grid.
|
static interface |
GridView.GridStateStyles
Marker classes, used only to indicate state and landmark details in the dom.
|
static interface |
GridView.GridStyles |
static interface |
GridView.GridTemplates |
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoFill
Set to true to auto expand the columns to fit the grid when the grid is created.
|
protected XElement |
body
The content area inside the scroller.
|
protected int |
borderWidth
A border width calculation to be applied for browsers that do not use the old IE box model.
|
protected ColumnModel<M> |
cm
The grid's column model.
|
protected ColumnModelHandlers |
columnListener
The handler for column events such as move, width change and hide.
|
protected XElement |
dataTable
The main data table and body.
|
protected XElement |
dataTableBody
The main data table and body.
|
protected XElement |
dataTableSizingHead
The main data table and body.
|
protected int |
deferUpdateDelay |
protected boolean |
deferUpdates |
protected ListStore<M> |
ds
The list store that provides data for this grid view.
|
protected String |
emptyText
The value to display when the grid is empty (defaults to empty string).
|
protected boolean |
enableRowBody
True to enable a column spanning row body, as used by
RowExpander (defaults to false). |
protected ColumnFooter<M> |
footer |
protected boolean |
forceFit |
protected Grid<M> |
grid |
protected ColumnHeader<M> |
header |
protected int |
headerColumnIndex |
protected boolean |
headerDisabled |
protected XElement |
headerElem
The inner head element.
|
protected int |
lastViewWidth |
protected StoreHandlers<M> |
listener |
protected Element |
overRow |
protected boolean |
preventScrollToTopOnRefresh |
protected XElement |
scroller
The scrollable area that contains the main body.
|
protected int |
scrollOffset |
protected boolean |
selectable |
protected SortInfo |
sortState |
protected int |
splitterWidth |
protected GridView.GridStateStyles |
states |
protected Store.StoreSortInfo<M> |
storeSortInfo |
protected GridView.GridStyles |
styles |
protected GridView.GridTemplates |
tpls |
protected String |
unselectable |
protected boolean |
vbar |
protected GridViewConfig<M> |
viewConfig |
Constructor and Description |
---|
GridView()
Creates a new grid view.
|
GridView(GridView.GridAppearance appearance)
Creates a new grid view.
|
Modifier and Type | Method and Description |
---|---|
<H extends EventHandler> |
addHandler(<any> type,
H handler)
Adds a handler to receive specific events from this object.
|
protected void |
adjustColumnWidths(int[] columnWidths) |
protected void |
afterRender()
Invoked after the view element is first attached, performs steps that require that the view element is attached.
|
protected void |
applyEmptyText()
Applies the empty text, then displaying it if the grid is empty.
|
protected void |
autoExpand(boolean preventUpdate)
Expands the column that was specified (via
setAutoExpandColumn(com.sencha.gxt.widget.core.client.grid.ColumnConfig<M, ?>) ) as the column in this grid that should
expand to fill unused space. |
protected void |
calculateVBar(boolean force)
Determines whether the need for a vertical scroll bar has changed and if so updates the display.
|
protected Menu |
createContextMenu(int colIndex)
Creates a context menu for the given column, including sort menu items and column visibility sub-menu.
|
protected <V> Store.StoreSortInfo<M> |
createStoreSortInfo(ColumnConfig<M,V> column,
SortDir sortDir)
Helper method that creates a StoreSortInfo from the given ColumnConfig and sort direction.
|
protected void |
doAttach()
Attaches ancillary widgets such as the header and footer to the grid.
|
protected void |
doDetach()
Detaches ancillary widgets such as the header and footer from the grid.
|
protected SafeHtml |
doRender(List<ColumnData> cs,
List<M> rows,
int startRow)
Renders the grid view into safe HTML.
|
protected void |
doSort(int colIndex,
SortDir sortDir)
Defaults to assume one sort at a time.
|
Point |
ensureVisible(int row,
int col,
boolean hscroll)
Ensured the current row and column is visible.
|
Point |
ensureVisible(M model)
Ensures the given model (row) is visible.
|
Element |
findCell(Element elem)
Returns the cell.
|
int |
findCellIndex(Element elem,
String requiredStyle)
Returns the cell index.
|
Element |
findRow(Element elem)
Returns the row element.
|
int |
findRowIndex(Element elem)
Returns the row index.
|
void |
fireEvent(<any> event)
Fires the given event from this object as its source.
|
protected void |
fitColumns(boolean preventRefresh,
boolean onlyExpand,
int omitColumn)
Distribute the width of the columns amongst the available grid width as required by
setAutoFill(boolean)
and setForceFit(boolean) . |
void |
focus()
Focuses the grid.
|
void |
focusCell(int rowIndex,
int colIndex,
boolean hscroll)
Focus the cell and scrolls into view.
|
void |
focusRow(int rowIndex)
Focus the row and scrolls into view.
|
GridView.GridAppearance |
getAppearance()
Returns the grid appearance.
|
ColumnConfig<M,?> |
getAutoExpandColumn()
Returns the auto expand column id.
|
int |
getAutoExpandMax()
Returns the auto expand maximum width.
|
int |
getAutoExpandMin()
Returns the auto expand minimum width.
|
XElement |
getBody()
Returns the body element.
|
Element |
getCell(int row,
int col)
Returns the grid's <TD> HtmlElement at the specified coordinates.
|
protected List<ColumnData> |
getColumnData()
Gets the properties required for rendering the columns.
|
protected SafeStyles |
getColumnStyle(int colIndex,
boolean isHeader)
Returns the CSS styles for the given column.
|
protected int |
getColumnWidth(int col)
Returns the width of the given column
|
protected int[] |
getColumnWidths() |
Element |
getEditorParent()
Returns the editor parent element.
|
String |
getEmptyText()
Returns the empty text.
|
ColumnHeader<M> |
getHeader()
Returns the grid's column header.
|
protected int |
getOffsetWidth()
Returns the offset width of the grid including the total visible column width and the amount required or reserved
for the vertical scroll bar.
|
protected <N> SafeHtml |
getRenderedValue(int rowIndex,
int colIndex,
M m,
Store.Record record)
Renders the value of a cell into safe HTML.
|
Element |
getRow(int row)
Return the <TR> HtmlElement which represents a Grid row for the specified index.
|
Element |
getRow(M m)
Return the <TR> HtmlElement which represents a Grid row for the specified model.
|
Element |
getRowBody(Element row) |
int |
getRowBodyRowSpan()
Returns the number of rows the first column should span when row bodies have been enabled.
|
protected <any> |
getRows()
Returns the HTML elements representing the body of the table.
|
protected int |
getScrollAdjust()
Returns the number of pixels required or reserved for the vertical scroll bar.
|
XElement |
getScroller()
Returns the scroll element.
|
Point |
getScrollState()
Returns the current scroll state.
|
Store.StoreSortInfo<M> |
getSortState()
Returns the grid's sort information.
|
GridView.GridStateStyles |
getStateStyles() |
protected int |
getTotalWidth()
The total width of the visible columns in the grid (for the width including the vertical scroll bar, see
getOffsetWidth() . |
GridViewConfig<M> |
getViewConfig()
Returns the view config.
|
protected void |
handleComponentEvent(Event event)
Handles browser events of interest to the grid view.
|
protected boolean |
hasRows()
Returns true if the grid has rows.
|
protected void |
init(Grid<M> grid)
Initializes the view.
|
protected void |
initData(ListStore<M> ds,
ColumnModel<M> cm)
Initializes the data.
|
protected void |
initElements()
Collects references to the HTML elements of the grid view and saves them in instance variables for future
reference.
|
protected void |
initHeader()
Initializes the column header and saves reference for future use, creating one if it hasn't yet been set
|
protected void |
initListeners()
Creates the grid view listeners, including
StoreHandlers and ColumnModelHandlers , and saves
references for future use. |
protected void |
initUI(Grid<M> grid)
Invoked to perform additional initialization of the grid view's user interface, after the data has been
initialized, the default implementation for
GridView does nothing. |
protected void |
insertRows(int firstRow,
int lastRow,
boolean isUpdate)
Inserts the given rows (already present in the grid's list store) into the grid view.
|
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 |
isColumnLines()
Returns true if column lines are enabled.
|
boolean |
isDeferUpdates()
Returns true if rows are updated deferred on updates.
|
boolean |
isEnableRowBody()
Returns true if row bodies are enabled.
|
boolean |
isForceFit()
Returns true if force fit is enabled.
|
protected boolean |
isRemoteSort()
Return true if configured for remote sorting.
|
boolean |
isSelectableTarget(Element target)
Returns true if the given element is selectable.
|
boolean |
isShowDirtyCells()
Returns true if dirty cell markers are enabled.
|
boolean |
isSortingEnabled()
Returns true if sorting is enabled.
|
boolean |
isStripeRows()
Returns true if row striping is enabled.
|
boolean |
isTrackMouseOver()
Returns true if rows are highlighted on mouse over.
|
void |
layout()
Lays out the grid view, adjusting the header and footer width and accounting for force fit and auto fill settings.
|
protected void |
layout(boolean skipResize)
Lays out the grid view, adjusting the header and footer width and accounting for force fit and auto fill settings.
|
protected void |
notifyHide()
Invoked after the grid has been hidden, the default implementation for
GridView does nothing. |
protected void |
notifyShow()
Invoked after the grid has been shown.
|
protected void |
onAdd(List<M> models,
int index)
Handles adding new data models to the store.
|
protected void |
onAfterRenderView()
Invoked after the view has been rendered, may be overridden to perform any
activities that require a rendered view.
|
protected void |
onCellDeselect(int row,
int col)
Handles the clearing of the selection for the given cell.
|
protected void |
onCellSelect(int row,
int col)
Handles selecting the given cell.
|
protected void |
onClear(StoreClearEvent<M> se)
Handles clearing the store.
|
protected void |
onClick(Event ce)
Handles the click event, the default implementation for
GridView does nothing. |
protected void |
onColumnMove(int newIndex)
Handles the column move request.
|
protected void |
onColumnWidthChange(int column,
int width)
Handles a change to the column model width (see
ColumnModel.setColumnWidth(int, int) ); |
protected void |
onDataChanged(StoreDataChangeEvent<M> se)
Handles a change in the data in the store, including changes to the filter or sort state.
|
protected void |
onFocus(Event event) |
protected void |
onHeaderChange(int column,
SafeHtml text)
Handles a change in the safe HTML that represents the header (see
ColumnModel.setColumnHeader(int, SafeHtml) ). |
protected void |
onHeaderClick(HeaderClickEvent event)
Handles a header click event.
|
protected void |
onHiddenChange(ColumnModel<M> cm,
int col,
boolean hidden)
Handles a change in the column model's hidden state (see
ColumnModel.setHidden(int, boolean) ). |
protected void |
onHighlightRow(int rowIndex,
boolean highlight)
Handles a request to change the highlight state of a row.
|
protected void |
onMouseDown(Event ge)
Invoked when a mouse down event occurs, the default implementation for
GridView does nothing. |
protected void |
onNoNext(int index)
Called with key down is pressed while on last row.
|
protected void |
onNoPrev()
Called when key up is pressed while on first row.
|
protected void |
onRemove(M m,
int index,
boolean isUpdate)
Handles removing a data model from the store.
|
protected void |
onRowDeselect(int rowIndex)
Handles clearing the selection on a row.
|
protected void |
onRowOut(Element row)
Handles moving the mouse off a row.
|
protected void |
onRowOver(Element row)
Handles moving the mouse onto a row.
|
protected void |
onRowSelect(int rowIndex)
Handles setting the selection on a row.
|
protected void |
onUpdate(ListStore<M> store,
List<M> models)
Handles an update to data in the store.
|
protected void |
processRows(int startRow,
boolean skipStripe)
Makes a pass through the rows in the grid to finalize the appearance, the default implementation in
GridView assigns the row index property and stripes the rows (if striping is enabled). |
void |
refresh(boolean headerToo)
Rebuilds the grid using its current configuration and data.
|
protected void |
refreshRow(int row)
Refreshes the displayed content for the given row.
|
protected void |
removeRow(int row)
Removes the given row.
|
protected void |
renderFooter()
Renders the footer.
|
protected void |
renderHeader()
Renders the header.
|
protected SafeHtml |
renderHiddenHeaders(int[] columnWidths)
Renders the hidden TH elements that keep the column widths.
|
protected SafeHtml |
renderRows(int startRow,
int endRow)
Renders the grid's rows.
|
protected void |
renderUI()
Responsible for rendering all aspects of the grid view.
|
protected void |
repaintGrid() |
protected void |
resize()
Resizes the grid view, adjusting the scroll bars and accounting for the footer height (if any).
|
protected void |
restoreScroll(Point state)
Restores the scroll state.
|
void |
scrollToTop()
Scrolls the grid to the top.
|
void |
scrollToTop(boolean resetHorizontal)
Scrolls the grid the top.
|
void |
setAdjustForHScroll(boolean adjustForHScroll)
True to adjust the grid width when the horizontal scrollbar is hidden and visible (defaults to true).
|
void |
setAutoExpandColumn(ColumnConfig<M,?> 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 500, pre-render).
|
void |
setAutoExpandMin(int autoExpandMin)
The minimum width the autoExpandColumn can have (if enabled)(pre-render).
|
void |
setAutoFill(boolean autoFill)
True to auto expand the columns to fit the grid when the grid is created.
|
void |
setColumnHeader(ColumnHeader<M> columnHeader) |
void |
setColumnLines(boolean columnLines)
True to enable column separation lines (defaults to false).
|
void |
setDeferUpdates(boolean deferUpdates)
True to update rows deferred (defaults to false).
|
void |
setEmptyText(String emptyText)
Default text to display in the grid body when no rows are available (defaults to '').
|
void |
setEnableRowBody(boolean enableRowBody)
True to enable a column spanning row body, as used by
RowExpander (defaults to false). |
void |
setForceFit(boolean forceFit)
True to auto expand/contract the size of the columns to fit the grid width and prevent horizontal scrolling
(defaults to false).
|
void |
setRowBodyRowSpan(int rowBodyRowSpan)
Sets the rowspan the first column should span when row bodies have been enabled (defaults to 1).
|
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 |
setSortingEnabled(boolean sortable)
True to allow column sorting when the user clicks a column (defaults to true).
|
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 |
setViewConfig(GridViewConfig<M> viewConfig)
Sets the view config.
|
protected void |
syncHeaderScroll()
Synchronizes the header position (and footer, if present) with the horizontal scroll bar.
|
protected void |
syncScroll()
Synchronizes the grid scroll bars.
|
protected void |
templateOnAllColumnWidthsUpdated(int[] columnWidths,
int tw)
Invoked after all column widths have been updated, the default implementation for
GridView does nothing. |
protected void |
templateOnColumnHiddenUpdated(int col,
boolean hidden,
int tw)
Invoked after the hidden column status been updated, the default implementation for
GridView does nothing. |
protected void |
templateOnColumnWidthUpdated(int col,
int w,
int tw)
Invoked after a column width has been updated, the default implementation for
GridView does nothing. |
protected void |
updateAllColumnWidths()
Synchronizes the displayed width of each column with the defined width of each column from its column model.
|
protected void |
updateColumnHidden(int index,
boolean hidden)
Updates the row width and cell display properties to hide or show the given column.
|
protected void |
updateColumnWidth(int col,
int width)
Updates the column width to the given value, which should have previously been stored in the column model.
|
protected void |
updateHeaderSortState()
Update the header to reflect any changes in the sort state.
|
protected void |
updateSortIcon(int colIndex,
SortDir dir)
Updates the sort icon for the given column and sort direction.
|
protected boolean autoFill
protected XElement body
protected int borderWidth
protected ColumnModel<M> cm
protected ColumnModelHandlers columnListener
protected XElement dataTable
protected XElement dataTableBody
protected XElement dataTableSizingHead
protected int deferUpdateDelay
protected boolean deferUpdates
protected String emptyText
protected boolean enableRowBody
RowExpander
(defaults to false).protected ColumnFooter<M> footer
protected boolean forceFit
protected ColumnHeader<M> header
protected int headerColumnIndex
protected boolean headerDisabled
protected XElement headerElem
protected int lastViewWidth
protected StoreHandlers<M> listener
protected Element overRow
protected boolean preventScrollToTopOnRefresh
protected XElement scroller
protected int scrollOffset
protected boolean selectable
protected SortInfo sortState
protected int splitterWidth
protected final GridView.GridStateStyles states
protected Store.StoreSortInfo<M> storeSortInfo
protected GridView.GridStyles styles
protected GridView.GridTemplates tpls
protected String unselectable
protected boolean vbar
protected GridViewConfig<M> viewConfig
public GridView()
public GridView(GridView.GridAppearance appearance)
appearance
- the grid appearancepublic <H extends EventHandler> HandlerRegistration addHandler(<any> type, H handler)
H
- the handler typetype
- the type of event to listen forhandler
- the handler to call when the event occurspublic Point ensureVisible(M model)
model
- the target modelpublic Point ensureVisible(int row, int col, boolean hscroll)
row
- the row indexcol
- the column indexhscroll
- true to scroll horizontally if neededpublic Element findCell(Element elem)
elem
- the cell element or a child elementpublic int findCellIndex(Element elem, String requiredStyle)
elem
- the cell or child elementrequiredStyle
- an optional required style namepublic Element findRow(Element elem)
elem
- the row element or any child elementpublic int findRowIndex(Element elem)
elem
- the row or child of the row elementpublic void fireEvent(<any> event)
event
- the event to firepublic void focus()
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 GridView.GridAppearance getAppearance()
public ColumnConfig<M,?> getAutoExpandColumn()
public int getAutoExpandMax()
public int getAutoExpandMin()
public XElement getBody()
public Element getCell(int row, int col)
row
- the row index in which to find the cellcol
- the column index of the cellpublic Element getEditorParent()
public String getEmptyText()
public ColumnHeader<M> getHeader()
public Element getRow(int row)
row
- the row indexpublic Element getRow(M m)
m
- the modelpublic Element getRowBody(Element row)
public int getRowBodyRowSpan()
public XElement getScroller()
public Point getScrollState()
public Store.StoreSortInfo<M> getSortState()
public GridView.GridStateStyles getStateStyles()
public GridViewConfig<M> getViewConfig()
public boolean isAdjustForHScroll()
public boolean isAutoFill()
public boolean isColumnLines()
public boolean isDeferUpdates()
public boolean isEnableRowBody()
public boolean isForceFit()
public boolean isSelectableTarget(Element target)
target
- the element to checkpublic boolean isShowDirtyCells()
public boolean isSortingEnabled()
public boolean isStripeRows()
public boolean isTrackMouseOver()
public void layout()
public void refresh(boolean headerToo)
headerToo
- true to refresh the headerprotected void onAfterRenderView()
public void scrollToTop()
public void scrollToTop(boolean resetHorizontal)
resetHorizontal
- true to reset horizontalpublic void setAdjustForHScroll(boolean adjustForHScroll)
adjustForHScroll
- true to adjust for horizontal scroll barpublic void setAutoExpandColumn(ColumnConfig<M,?> autoExpandColumn)
autoExpandColumn
- the auto expand columnpublic void setAutoExpandMax(int autoExpandMax)
autoExpandMax
- the auto expand maxpublic void setAutoExpandMin(int autoExpandMin)
autoExpandMin
- the auto expand min widthpublic void setAutoFill(boolean autoFill)
autoFill
- true to expandpublic void setColumnLines(boolean columnLines)
columnLines
- true to enable column separation linespublic void setDeferUpdates(boolean deferUpdates)
deferUpdates
- true to update deferredpublic void setEmptyText(String emptyText)
emptyText
- the empty textpublic void setEnableRowBody(boolean enableRowBody)
RowExpander
(defaults to false).enableRowBody
- true to enable row bodiespublic void setForceFit(boolean forceFit)
forceFit
- true to force fitpublic void setRowBodyRowSpan(int rowBodyRowSpan)
rowBodyRowSpan
- the rowspanpublic void setShowDirtyCells(boolean showDirtyCells)
showDirtyCells
- true to display the dirty flagpublic void setSortingEnabled(boolean sortable)
sortable
- true for sortable columnspublic void setStripeRows(boolean stripeRows)
stripeRows
- true to strip rowspublic void setTrackMouseOver(boolean trackMouseOver)
trackMouseOver
- true to highlight rows on mouse overpublic void setViewConfig(GridViewConfig<M> viewConfig)
viewConfig
- the view configprotected void adjustColumnWidths(int[] columnWidths)
protected void afterRender()
protected void applyEmptyText()
protected void autoExpand(boolean preventUpdate)
setAutoExpandColumn(com.sencha.gxt.widget.core.client.grid.ColumnConfig<M, ?>)
) as the column in this grid that should
expand to fill unused space.preventUpdate
- true to update the column model width without updating the displayed width.protected void calculateVBar(boolean force)
force
- true to force the display to update regardless of whether a change has occurred.protected Menu createContextMenu(int colIndex)
colIndex
- the column indexprotected <V> Store.StoreSortInfo<M> createStoreSortInfo(ColumnConfig<M,V> column, SortDir sortDir)
Comparator
, if any, otherwise will fall back to assuming that the data in the column is
Comparable
.column
- the column configsortDir
- the sort directionprotected void doAttach()
protected void doDetach()
protected SafeHtml doRender(List<ColumnData> cs, List<M> rows, int startRow)
cs
- the column attributes required for renderingrows
- the data models for the rows to be renderedstartRow
- the index of the first row in rows
protected void doSort(int colIndex, SortDir sortDir)
colIndex
- the column to sortsortDir
- the sort directionprotected void fitColumns(boolean preventRefresh, boolean onlyExpand, int omitColumn)
setAutoFill(boolean)
and setForceFit(boolean)
.preventRefresh
- true to perform calculations and update column models but do not update displayonlyExpand
- unused in GridView
implementationomitColumn
- index of column to exclude from operationprotected List<ColumnData> getColumnData()
protected SafeStyles getColumnStyle(int colIndex, boolean isHeader)
colIndex
- the column indexisHeader
- true to include the column header stylesprotected int getColumnWidth(int col)
col
- the column indexprotected int[] getColumnWidths()
protected int getOffsetWidth()
protected <N> SafeHtml getRenderedValue(int rowIndex, int colIndex, M m, Store.Record record)
rowIndex
- the row indexcolIndex
- the column indexm
- the data modelrecord
- the optional Store.Record
for this row (may be null)protected <any> getRows()
protected int getScrollAdjust()
protected int getTotalWidth()
getOffsetWidth()
.protected void handleComponentEvent(Event event)
GridView
includes
support for mouse-over tracking (see setTrackMouseOver(boolean)
and scroll bar synchronization.event
- the browser eventprotected boolean hasRows()
public void setColumnHeader(ColumnHeader<M> columnHeader)
protected void initHeader()
protected void initData(ListStore<M> ds, ColumnModel<M> cm)
ds
- the data storecm
- the column modelprotected void initElements()
protected void initListeners()
StoreHandlers
and ColumnModelHandlers
, and saves
references for future use.protected void initUI(Grid<M> grid)
GridView
does nothing.grid
- the grid for this grid viewprotected void insertRows(int firstRow, int lastRow, boolean isUpdate)
firstRow
- the first row indexlastRow
- the last row indexisUpdate
- true if update to existing rowsprotected boolean isRemoteSort()
protected void layout(boolean skipResize)
skipResize
- true to skip resizing of the grid viewprotected void notifyHide()
GridView
does nothing.protected void notifyShow()
protected void onAdd(List<M> models, int index)
models
- the new data modelsindex
- the index of the first modelprotected void onCellDeselect(int row, int col)
row
- the row indexcol
- the cell indexprotected void onCellSelect(int row, int col)
row
- the row indexcol
- the cell indexprotected void onClear(StoreClearEvent<M> se)
se
- the event that cleared the storeprotected void onClick(Event ce)
GridView
does nothing.ce
- the click eventprotected void onColumnMove(int newIndex)
newIndex
- the destination column indexprotected void onColumnWidthChange(int column, int width)
ColumnModel.setColumnWidth(int, int)
);column
- the index of the columnwidth
- the new widthprotected void onDataChanged(StoreDataChangeEvent<M> se)
se
- the change (may be null)protected void onFocus(Event event)
protected void onHeaderChange(int column, SafeHtml text)
ColumnModel.setColumnHeader(int, SafeHtml)
).column
- the column indextext
- the new safe HTMLprotected void onHeaderClick(HeaderClickEvent event)
event
- the header click eventprotected void onHiddenChange(ColumnModel<M> cm, int col, boolean hidden)
ColumnModel.setHidden(int, boolean)
).cm
- the column modelcol
- the column indexhidden
- true if the column is hiddenprotected void onHighlightRow(int rowIndex, boolean highlight)
rowIndex
- the row indexhighlight
- true to highlight the rowprotected void onMouseDown(Event ge)
GridView
does nothing.protected void onNoNext(int index)
index
- the index of the last rowprotected void onNoPrev()
protected void onRemove(M m, int index, boolean isUpdate)
m
- the data modelindex
- the row indexisUpdate
- true to indicate an update an existing rowprotected void onRowDeselect(int rowIndex)
rowIndex
- the row indexprotected void onRowOut(Element row)
row
- the HTML element for the rowprotected void onRowOver(Element row)
row
- the HTML element for the rowprotected void onRowSelect(int rowIndex)
rowIndex
- the row indexprotected void onUpdate(ListStore<M> store, List<M> models)
store
- the storemodels
- the updated dataprotected void processRows(int startRow, boolean skipStripe)
GridView
assigns the row index property and stripes the rows (if striping is enabled).startRow
- the row indexskipStripe
- true to prevent striping (striping is always prevented if isStripeRows()
returns
false).protected void refreshRow(int row)
row
- the row indexprotected void removeRow(int row)
row
- the row indexprotected void renderFooter()
protected void renderHeader()
protected SafeHtml renderHiddenHeaders(int[] columnWidths)
columnWidths
- the column widthsprotected SafeHtml renderRows(int startRow, int endRow)
startRow
- the index in the store of the first row to renderendRow
- the index of the last row to render (may be -1 to indicate all rows)protected void renderUI()
protected void repaintGrid()
protected void resize()
protected void restoreScroll(Point state)
state
- the state as returned from a previous call to getScrollState()
.protected void syncHeaderScroll()
protected void syncScroll()
protected void templateOnAllColumnWidthsUpdated(int[] columnWidths, int tw)
GridView
does nothing.protected void templateOnColumnHiddenUpdated(int col, boolean hidden, int tw)
GridView
does nothing.protected void templateOnColumnWidthUpdated(int col, int w, int tw)
GridView
does nothing.protected void updateAllColumnWidths()
protected void updateColumnHidden(int index, boolean hidden)
index
- the column indexhidden
- true to hide the columnprotected void updateColumnWidth(int col, int width)
col
- the column indexwidth
- the width of the columnprotected void updateHeaderSortState()
protected void updateSortIcon(int colIndex, SortDir dir)
colIndex
- the column indexdir
- the sort directionCopyright © 2018. All rights reserved.