Class FilteredList
- All Implemented Interfaces:
HasHandlers
,HasDataArrivedHandlers
,HasDataChangedHandlers
ResultSet
designed to provide a synchronously filterable List interface
for an array of data. Developers should set allRows
to the
full set of data objects, and use criteria
to the apply criteria
to the data set. Standard List APIs such as List.get()
, List.getLength()
, List.getRange()
, etc will then allow access to a filtered subset of this data.
The dataSource
attribute may be used to specify the format of records
to be stored within this list, but this is not required. If no DataSource is explicitly specified, filteredList will
automatically generate its own DataSource with dropUnknownCriteria
set to false.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.smartgwt.client.data.RecordList
RecordList.SortNormalizer
-
Field Summary
Fields inherited from class com.smartgwt.client.data.RecordList
jsObj
Fields inherited from class com.smartgwt.client.core.BaseClass
config, configOnly, factoryCreated, factoryProperties, id, scClassName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
Record[]
Complete set of records for this filteredList.Optional dataSource to specifying field names and types for records within this List.boolean
When true, allows the ResultSet to be modified by list APIsList.addAt()
,List.set()
, andList.removeAt()
.static FilteredList
getOrCreateRef
(JavaScriptObject jsObj) void
Invoking invalidateCache() will have no effect on a filteredList.setAllRows
(Record... allRows) Complete set of records for this filteredList.setDataSource
(DataSource dataSource) Optional dataSource to specifying field names and types for records within this List.setModifiable
(boolean modifiable) When true, allows the ResultSet to be modified by list APIsList.addAt()
,List.set()
, andList.removeAt()
.Methods inherited from class com.smartgwt.client.data.ResultSet
addDataArrivedHandler, allMatchingRowsCached, allRowsCached, applyFilter, applyFilter, asSGWTComponent, compareCriteria, compareCriteria, compareCriteria, dataArrived, ensureCreated, fetchRowCount, fetchRowCount, fetchRowCount, filterLocalData, find, find, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findByKey, findByKey, findIndex, findIndex, findIndex, findIndex, findIndex, findIndex, findIndex, findNextIndex, findNextIndex, findNextIndex, findNextIndex, findNextIndex, findNextIndex, findNextIndex, get, getAllCachedRows, getAllVisibleRows, getAlwaysRequestVisibleRows, getApplyRowCountToLength, getAutoFetchRowCount, getBlockingRowCountFetch, getCachedRange, getCombinedCriteria, getCombinedCriteriaAsAdvancedCriteria, getCriteria, getCriteriaPolicy, getDisableCacheSync, getDropCacheOnUpdate, getFetchDelay, getFetchMode, getFetchOperation, getImplicitCriteria, getLength, getLoadingMarker, getNeverDropUpdatedRows, getPaletteDefaults, getPrerequisiteFieldGenerationNotSuccessfulErrorMessage, getProgressiveLoading, getProperty, getRange, getRangeAsRecordList, getReapplyUnchangedLocalFilter, getRememberDynamicProgressiveLoading, getRequestProperties, getResultSize, getRowCount, getRowCountContext, getRowCountOperation, getRowCountRange, getRowCountStatus, getSort, getUpdateCacheFromRequest, getUpdatePartialCache, getUseClientFiltering, getUseClientSorting, getValueMap, indexOf, indexOf, indexOf, indexOf, indexOf, isResultSet, lengthIsKnown, lengthIsProgressive, rangeIsLoaded, resort, rowIsLoaded, setAlwaysRequestVisibleRows, setApplyRowCountToLength, setAutoFetchRowCount, setBlockingRowCountFetch, setCriteria, setCriteriaPolicy, setDisableCacheSync, setDropCacheOnUpdate, setFetchDelay, setFetchMode, setFetchOperation, setFullLength, setImplicitCriteria, setInitialData, setInitialLength, setInitialSort, setJavaScriptObject, setNeverDropUpdatedRows, setPrerequisiteFieldGenerationNotSuccessfulErrorMessage, setProgressiveLoading, setReapplyUnchangedLocalFilter, setRememberDynamicProgressiveLoading, setRequestProperties, setResultSize, setRowCountContext, setRowCountOperation, setSort, setSortSpecifiers, setUpdateCacheFromRequest, setUpdatePartialCache, setUseClientFiltering, setUseClientSorting, sortByProperty, sortByProperty, sortByProperty, unsort, usingFilteredData, willFetchData, willFetchData
Methods inherited from class com.smartgwt.client.data.RecordList
add, addAt, addDataChangedHandler, addList, addList, addListAt, contains, contains, containsAll, duplicate, equals, find, find, find, find, findIndex, findNextIndex, findNextIndex, findNextIndex, first, getItems, getJsObj, getOrCreateJsObj, getRangeList, intersect, isARecordList, isCreated, isEmpty, last, lastIndexOf, lastIndexOf, remove, removeAt, removeList, set, setLength, setSort, sort, sort, sortByProperty, toArray
Methods inherited from class com.smartgwt.client.core.BaseClass
addDynamicProperty, addDynamicProperty, addDynamicProperty, addDynamicProperty, applyFactoryProperties, clearDynamicProperty, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getRef, getRuleScope, getScClassName, getTestInstance, hasAutoAssignedID, hasDynamicProperty, internalSetID, internalSetID, isConfigOnly, isFactoryCreated, onBind, onInit, registerID, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setConfigOnly, setFactoryCreated, setID, setProperty, setProperty, setProperty, setProperty, setRuleScope, setScClassName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Constructor Details
-
FilteredList
public FilteredList() -
FilteredList
-
-
Method Details
-
getOrCreateRef
-
create
-
setAllRows
Complete set of records for this filteredList. Sorting and filtering of this list will occur synchronously on the client.
If this method is called after the component has been drawn/initialized: UpdatesallRows
at run time.Note : This is an advanced setting
- Overrides:
setAllRows
in classResultSet
- Parameters:
allRows
- New set of unfiltered cache data. Default value is []- Returns:
FilteredList
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created
-
getAllRows
Complete set of records for this filteredList. Sorting and filtering of this list will occur synchronously on the client.- Overrides:
getAllRows
in classResultSet
- Returns:
- Current allRows value. Default value is []
-
setDataSource
Optional dataSource to specifying field names and types for records within this List. Note that since a full data set should be provided to the list viaallRows
, this filteredList will not issue fetch requests against this DataSource.If no DataSource was explicitly specified, filteredList will automatically generate its own DataSource with
dropUnknownCriteria
set to false.- Overrides:
setDataSource
in classResultSet
- Parameters:
dataSource
- New dataSource value. Default value is null- Returns:
FilteredList
instance, for chaining setter calls- Throws:
IllegalStateException
- this property cannot be changed after the underlying component has been created- See Also:
-
getDataSource
Optional dataSource to specifying field names and types for records within this List. Note that since a full data set should be provided to the list viaallRows
, this filteredList will not issue fetch requests against this DataSource.If no DataSource was explicitly specified, filteredList will automatically generate its own DataSource with
dropUnknownCriteria
set to false.- Overrides:
getDataSource
in classResultSet
- Returns:
- Current dataSource value. Default value is null
- See Also:
-
setModifiable
When true, allows the ResultSet to be modified by list APIsList.addAt()
,List.set()
, andList.removeAt()
. Only applies tofetchMode
:"local" ResultSets, since in all other cases, such modifications would break the consistency of server and client row numbering needed for data paging, and also create some issues with automatic cache synchronization. See the "Modifying ResultSets" subtopic in theResultSet Overview
for the alternative approach of updating theDataSource
.One known case where modification can be useful is when an array has been passed to
ListGrid.setData()
for a ListGrid withListGrid.filterLocalData
:true. If the data is filtered using thefilterEditor
, then a new local ResultSet will be created asdata
to reflect the filtering.- Overrides:
setModifiable
in classResultSet
- Parameters:
modifiable
- New modifiable value. Default value is true- Returns:
FilteredList
instance, for chaining setter calls- See Also:
-
getModifiable
public boolean getModifiable()When true, allows the ResultSet to be modified by list APIsList.addAt()
,List.set()
, andList.removeAt()
. Only applies tofetchMode
:"local" ResultSets, since in all other cases, such modifications would break the consistency of server and client row numbering needed for data paging, and also create some issues with automatic cache synchronization. See the "Modifying ResultSets" subtopic in theResultSet Overview
for the alternative approach of updating theDataSource
.One known case where modification can be useful is when an array has been passed to
ListGrid.setData()
for a ListGrid withListGrid.filterLocalData
:true. If the data is filtered using thefilterEditor
, then a new local ResultSet will be created asdata
to reflect the filtering.- Overrides:
getModifiable
in classResultSet
- Returns:
- Current modifiable value. Default value is true
- See Also:
-
invalidateCache
public void invalidateCache()Invoking invalidateCache() will have no effect on a filteredList. To drop the allRows cache of data, consider passing an empty array tosetAllRows()
.- Overrides:
invalidateCache
in classResultSet
-