com.extjs.gxt.ui.client.widget.grid
Class BufferView

java.lang.Object
  extended by com.extjs.gxt.ui.client.event.BaseObservable
      extended by com.extjs.gxt.ui.client.widget.grid.GridView
          extended by com.extjs.gxt.ui.client.widget.grid.BufferView
All Implemented Interfaces:
Observable
Direct Known Subclasses:
TreeGridView

public class BufferView
extends GridView

Renders the rows as they scroll into view. This GridView is fast for displaying many rows at once, but it does not support all features the normal {link @GridView} supports, such has expanding rows.

Only works with constant row heights that can be specified using setRowHeight(int).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.extjs.gxt.ui.client.widget.grid.GridView
GridView.GridViewImages
 
Field Summary
 
Fields inherited from class com.extjs.gxt.ui.client.widget.grid.GridView
activeHdIndex, autoFill, borderWidth, cm, columnListener, deferEmptyText, ds, el, emptyText, enableHdMenu, enableRowBody, focusEl, focusEnabled, footer, forceFit, grid, header, headerColumnIndex, headerDisabled, images, innerHd, lastViewWidth, listener, mainBody, mainHd, mainWrap, overRow, preventScrollToTopOnRefresh, scroller, scrollOffset, selectable, sortState, splitterWidth, templates, userResized, vbar, viewConfig, widgetList
 
Constructor Summary
BufferView()
           
 
Method Summary
protected  void clean()
           
protected  void cleanModel(ModelData at)
           
protected  void doAttach()
           
protected  void doClean()
           
protected  java.lang.String doRender(java.util.List<ColumnData> cs, java.util.List<ModelData> rows, int startRow, int colCount, boolean stripe)
           
protected  java.lang.String doRender(java.util.List<ColumnData> cs, java.util.List<ModelData> rows, int startRow, int colCount, boolean stripe, boolean onlyBody)
           
protected  void doUpdate()
           
 int getCacheSize()
          Returns the amount of rows that should be cached.
protected  int getCalculatedRowHeight()
           
 int getCleanDelay()
          Returns the amount of time before cleaning is done.
 int getRowHeight()
          Returns the height of one row.
 int getScrollDelay()
          Returns the amount of time before new rows are displayed after scrolling
protected  int getStyleRowHeight()
           
protected  int getVisibleRowCount()
           
protected  int[] getVisibleRows(int count)
           
 boolean isBufferEnabled()
          Returns true if buffering is enabled.
protected  boolean isRowRendered(int index)
           
protected  void layout(boolean skipResize)
           
protected  void notifyShow()
           
protected  void onAdd(ListStore<ModelData> store, java.util.List<ModelData> models, int index)
           
protected  void onRemove(ListStore<ModelData> ds, ModelData m, int index, boolean isUpdate)
           
 void setBufferEnabled(boolean bufferEnabled)
          True to enabled buffered functionality (defaults to true).
 void setCacheSize(int cacheSize)
          Sets the amount of rows that should be cached (default to 20).
 void setCleanDelay(int cleanDelay)
          Sets the amount of time before cleaning is done (defaults to 500).
 void setRowHeight(int rowHeight)
          Sets the height of one row (defaults to 19).
 void setScrollDelay(int scrollDelay)
          Sets the amount of time before new rows are displayed after scrolling (defaults to 0).
protected  void syncScroll()
           
protected  void update()
           
 
Methods inherited from class com.extjs.gxt.ui.client.widget.grid.GridView
addRowStyle, afterRender, applyEmptyText, autoExpand, calculateVBar, createComponentEvent, createContextMenu, detachWidget, detachWidgets, doDetach, doSort, ensureVisible, findCell, findCellIndex, findRow, findRowIndex, fitColumns, fly, focusCell, focusGrid, focusRow, getBody, getCell, getCellIndex, getCellSelectorDepth, getColumnData, getColumnStyle, getColumnWidth, getEditorParent, getEmptyText, getHeader, getHeaderCell, getImages, getOffsetWidth, getRenderedValue, getRow, getRow, getRows, getRowSelectorDepth, getScrollAdjust, getScroller, getScrollState, getSortState, getTotalWidth, getViewConfig, getWidget, getWidgetCell, handleComponentEvent, hasRows, init, initData, initElements, initListeners, initTemplates, initUI, insertRows, isAdjustForHScroll, isAutoFill, isForceFit, isShowDirtyCells, isShowInvalidCells, isSortingEnabled, layout, newColumnHeader, notifyHide, onBeforeDataChanged, onCellDeselect, onCellSelect, onClear, onClick, onColumnMove, onColumnSplitterMoved, onColumnWidthChange, onDataChanged, onHeaderChange, onHeaderClick, onHiddenChange, onHighlightRow, onMouseDown, onRowDeselect, onRowOut, onRowOver, onRowSelect, onUpdate, prepareData, processRows, refresh, refreshRow, removeRow, removeRowStyle, render, renderFooter, renderHeader, renderRows, renderUI, renderWidgets, resize, restoreScroll, scrollToTop, setAdjustForHScroll, setAutoFill, setCellSelectorDepth, setEmptyText, setForceFit, setRowSelectorDepth, setShowDirtyCells, setShowInvalidCells, setSortingEnabled, setViewConfig, stopEditing, syncHeaderScroll, syncHScroll, templateAfterMove, templateOnAllColumnWidthsUpdated, templateOnColumnHiddenUpdated, templateOnColumnWidthUpdated, templateOnLayout, templateUpdateColumnText, updateAllColumnWidths, updateColumnHidden, updateColumnWidth, updateHeaderSortState, updateSortIcon
 
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
 

Constructor Detail

BufferView

public BufferView()
Method Detail

getCacheSize

public int getCacheSize()
Returns the amount of rows that should be cached.

Returns:
the cache size

getCleanDelay

public int getCleanDelay()
Returns the amount of time before cleaning is done.

Returns:
the clean delay

getRowHeight

public int getRowHeight()
Returns the height of one row.

Returns:
the height of one row

getScrollDelay

public int getScrollDelay()
Returns the amount of time before new rows are displayed after scrolling

Returns:
the scroll delay

isBufferEnabled

public boolean isBufferEnabled()
Returns true if buffering is enabled.

Returns:
true for buffering

setBufferEnabled

public void setBufferEnabled(boolean bufferEnabled)
True to enabled buffered functionality (defaults to true).

Parameters:
bufferEnabled - true to buffer, otherwise false

setCacheSize

public void setCacheSize(int cacheSize)
Sets the amount of rows that should be cached (default to 20).

Parameters:
cacheSize - the new cache size

setCleanDelay

public void setCleanDelay(int cleanDelay)
Sets the amount of time before cleaning is done (defaults to 500).

Parameters:
cleanDelay - the new clean delay

setRowHeight

public void setRowHeight(int rowHeight)
Sets the height of one row (defaults to 19).

Parameters:
rowHeight - the new row height.

setScrollDelay

public void setScrollDelay(int scrollDelay)
Sets the amount of time before new rows are displayed after scrolling (defaults to 0).

Parameters:
scrollDelay - the new scroll delay.

clean

protected void clean()

cleanModel

protected void cleanModel(ModelData at)

doAttach

protected void doAttach()
Overrides:
doAttach in class GridView

doClean

protected void doClean()

doRender

protected java.lang.String doRender(java.util.List<ColumnData> cs,
                                    java.util.List<ModelData> rows,
                                    int startRow,
                                    int colCount,
                                    boolean stripe)
Overrides:
doRender in class GridView

doRender

protected java.lang.String doRender(java.util.List<ColumnData> cs,
                                    java.util.List<ModelData> rows,
                                    int startRow,
                                    int colCount,
                                    boolean stripe,
                                    boolean onlyBody)

doUpdate

protected void doUpdate()

getCalculatedRowHeight

protected int getCalculatedRowHeight()

getStyleRowHeight

protected int getStyleRowHeight()

getVisibleRowCount

protected int getVisibleRowCount()

getVisibleRows

protected int[] getVisibleRows(int count)

isRowRendered

protected boolean isRowRendered(int index)

layout

protected void layout(boolean skipResize)
Overrides:
layout in class GridView

notifyShow

protected void notifyShow()
Overrides:
notifyShow in class GridView

onAdd

protected void onAdd(ListStore<ModelData> store,
                     java.util.List<ModelData> models,
                     int index)
Overrides:
onAdd in class GridView

onRemove

protected void onRemove(ListStore<ModelData> ds,
                        ModelData m,
                        int index,
                        boolean isUpdate)
Overrides:
onRemove in class GridView

syncScroll

protected void syncScroll()
Overrides:
syncScroll in class GridView

update

protected void update()