public class LiveGridView<M> extends GridView<M> implements LiveGridViewUpdateEvent.HasLiveGridViewUpdateHandlers
GridView.GridAppearance, GridView.GridStateStyles, GridView.GridStyles, GridView.GridTemplates
Modifier and Type | Field and Description |
---|---|
protected ListStore<M> |
cacheStore
The secondary store.
|
protected XElement |
liveScroller |
protected int |
liveStoreOffset
The paging offset.
|
protected int |
totalCount
The total rows in data set.
|
protected int |
viewIndex
The current index of the view.
|
autoFill, body, borderWidth, cm, columnListener, dataTable, dataTableBody, dataTableSizingHead, deferUpdateDelay, deferUpdates, ds, emptyText, enableRowBody, footer, forceFit, grid, header, headerColumnIndex, headerDisabled, headerElem, lastViewWidth, listener, overRow, preventScrollToTopOnRefresh, scroller, scrollOffset, selectable, sortState, splitterWidth, states, storeSortInfo, styles, tpls, unselectable, vbar, viewConfig
Constructor and Description |
---|
LiveGridView()
Creates a new live grid view.
|
LiveGridView(GridView.GridAppearance appearance)
Creates a new live grid view instance with the given appearance.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addLiveGridViewUpdateHandler(LiveGridViewUpdateEvent.LiveGridViewUpdateHandler handler)
Adds a
LiveGridViewUpdateEvent.LiveGridViewUpdateHandler handler for LiveGridViewUpdateEvent events. |
protected void |
calculateVBar(boolean force)
Determines whether the need for a vertical scroll bar has changed and if so updates the display.
|
protected void |
doLoad() |
protected void |
doSort(int colIndex,
SortDir sortDir)
Defaults to assume one sort at a time.
|
int |
getCacheSize()
Returns the numbers of rows that should be cached.
|
protected int |
getLiveScrollerHeight() |
protected int |
getLiveStoreCalculatedIndex(int index) |
int |
getLoadDelay()
Returns the amount of time before loading is done.
|
double |
getPrefetchFactor()
Returns the prefetchFactor.
|
int |
getRowHeight()
Returns the height of one row.
|
protected int |
getScrollAdjust()
Returns the number of pixels required or reserved for the vertical scroll bar.
|
XElement |
getScroller()
Returns the live scroller element.
|
int |
getVisibleRowCount()
Returns the total number of rows that are visible given the current grid height.
|
protected void |
handleComponentEvent(Event event)
Handles browser events of interest to the grid view.
|
protected void |
initData(ListStore<M> ds,
ColumnModel<M> cm)
Initializes the data.
|
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.
|
protected boolean |
isCached(int index) |
protected boolean |
isHorizontalScrollBarShowing() |
protected boolean |
loadLiveStore(int offset) |
protected int |
measureRowHeight() |
protected void |
notifyShow()
Invoked after the grid has been shown.
|
protected void |
onAfterRenderView()
Invoked after the view has been rendered, may be overridden to perform any
activities that require a rendered view.
|
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 |
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.
|
void |
refresh()
Refreshed the view.
|
void |
refresh(boolean headerToo)
Rebuilds the grid using its current configuration and data.
|
protected void |
renderUI()
Responsible for rendering all aspects of the grid view.
|
protected void |
resize()
Resizes the grid view, adjusting the scroll bars and accounting for the footer height (if any).
|
void |
scrollToTop()
Scrolls the grid to the top.
|
void |
setCacheSize(int cacheSize)
Sets the amount of rows that should be cached (default to 200).
|
void |
setLoadDelay(int loadDelay)
Sets the amount of time before loading is done (defaults to 200).
|
void |
setPrefetchFactor(double prefetchFactor)
Sets the pre-fetch factor (defaults to .2).
|
protected void |
setRowHeight(int rowHeight)
Sets the height of one row (defaults to 20).
|
protected boolean |
shouldCache(int index) |
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 |
updateRows(int newIndex,
boolean reload)
Updates the rows based on the new index.
|
addHandler, adjustColumnWidths, afterRender, applyEmptyText, autoExpand, createContextMenu, createStoreSortInfo, doAttach, doDetach, doRender, ensureVisible, ensureVisible, findCell, findCellIndex, findRow, findRowIndex, fireEvent, fitColumns, focus, focusCell, focusRow, getAppearance, getAutoExpandColumn, getAutoExpandMax, getAutoExpandMin, getBody, getCell, getColumnData, getColumnStyle, getColumnWidth, getColumnWidths, getEditorParent, getEmptyText, getHeader, getOffsetWidth, getRenderedValue, getRow, getRow, getRowBody, getRowBodyRowSpan, getRows, getScrollState, getSortState, getStateStyles, getTotalWidth, getViewConfig, hasRows, init, initElements, initHeader, initListeners, initUI, isAdjustForHScroll, isAutoFill, isColumnLines, isDeferUpdates, isEnableRowBody, isForceFit, isRemoteSort, isSelectableTarget, isShowDirtyCells, isSortingEnabled, isStripeRows, isTrackMouseOver, layout, layout, notifyHide, onAdd, onCellDeselect, onCellSelect, onClear, onClick, onColumnMove, onColumnWidthChange, onFocus, onHeaderChange, onHeaderClick, onHiddenChange, onHighlightRow, onMouseDown, onRemove, onRowDeselect, onRowOut, onRowOver, onRowSelect, onUpdate, processRows, refreshRow, removeRow, renderFooter, renderHeader, renderHiddenHeaders, renderRows, repaintGrid, restoreScroll, scrollToTop, setAdjustForHScroll, setAutoExpandColumn, setAutoExpandMax, setAutoExpandMin, setAutoFill, setColumnHeader, setColumnLines, setDeferUpdates, setEmptyText, setEnableRowBody, setForceFit, setRowBodyRowSpan, setShowDirtyCells, setSortingEnabled, setStripeRows, setTrackMouseOver, setViewConfig, syncHeaderScroll, syncScroll, templateOnAllColumnWidthsUpdated, templateOnColumnHiddenUpdated, templateOnColumnWidthUpdated, updateHeaderSortState, updateSortIcon
protected XElement liveScroller
protected int liveStoreOffset
protected int totalCount
protected int viewIndex
public LiveGridView()
public LiveGridView(GridView.GridAppearance appearance)
appearance
- the appearance to use when rendering the grid viewpublic HandlerRegistration addLiveGridViewUpdateHandler(LiveGridViewUpdateEvent.LiveGridViewUpdateHandler handler)
LiveGridViewUpdateEvent.HasLiveGridViewUpdateHandlers
LiveGridViewUpdateEvent.LiveGridViewUpdateHandler
handler for LiveGridViewUpdateEvent
events.addLiveGridViewUpdateHandler
in interface LiveGridViewUpdateEvent.HasLiveGridViewUpdateHandlers
handler
- the handlerpublic int getCacheSize()
public void setCacheSize(int cacheSize)
cacheSize
- the new cache sizepublic int getLoadDelay()
public void setLoadDelay(int loadDelay)
loadDelay
- the new load delay in millisecondspublic double getPrefetchFactor()
public void setPrefetchFactor(double prefetchFactor)
prefetchFactor
- the pre-fetch factorpublic int getRowHeight()
protected void setRowHeight(int rowHeight)
rowHeight
- the new row height.public int getVisibleRowCount()
public void refresh()
public void refresh(boolean headerToo)
GridView
public void scrollToTop()
GridView
scrollToTop
in class GridView<M>
protected void calculateVBar(boolean force)
GridView
calculateVBar
in class GridView<M>
force
- true to force the display to update regardless of whether a change has occurred.protected void doLoad()
protected void doSort(int colIndex, SortDir sortDir)
GridView
protected int getLiveScrollerHeight()
protected int getLiveStoreCalculatedIndex(int index)
protected int getScrollAdjust()
GridView
getScrollAdjust
in class GridView<M>
public XElement getScroller()
getScroller
in class GridView<M>
protected void handleComponentEvent(Event event)
GridView
GridView
includes
support for mouse-over tracking (see GridView.setTrackMouseOver(boolean)
and scroll bar synchronization.handleComponentEvent
in class GridView<M>
event
- the browser eventprotected void initData(ListStore<M> ds, ColumnModel<M> cm)
GridView
protected void insertRows(int firstRow, int lastRow, boolean isUpdate)
GridView
insertRows
in class GridView<M>
firstRow
- the first row indexlastRow
- the last row indexisUpdate
- true if update to existing rowsprotected boolean isCached(int index)
protected boolean isHorizontalScrollBarShowing()
protected boolean loadLiveStore(int offset)
protected int measureRowHeight()
protected void notifyShow()
GridView
notifyShow
in class GridView<M>
protected void onAfterRenderView()
onAfterRenderView
in class GridView<M>
protected void onDataChanged(StoreDataChangeEvent<M> se)
GridView
onDataChanged
in class GridView<M>
se
- the change (may be null)protected void onNoNext(int index)
GridView
protected void onNoPrev()
GridView
protected void renderUI()
GridView
protected void resize()
GridView
protected boolean shouldCache(int index)
protected void updateAllColumnWidths()
GridView
updateAllColumnWidths
in class GridView<M>
protected void updateColumnHidden(int index, boolean hidden)
GridView
updateColumnHidden
in class GridView<M>
index
- the column indexhidden
- true to hide the columnprotected void updateColumnWidth(int col, int width)
GridView
updateColumnWidth
in class GridView<M>
col
- the column indexwidth
- the width of the columnprotected void updateRows(int newIndex, boolean reload)
newIndex
- the new indexreload
- true to reload the dataCopyright © 2018. All rights reserved.