Package com.smartgwt.client.data

# Class FilteredList

java.lang.Object
com.smartgwt.client.core.BaseClass
com.smartgwt.client.data.RecordList
com.smartgwt.client.data.ResultSet
com.smartgwt.client.data.FilteredList

All Implemented Interfaces:
  `HasHandlers`, `HasDataArrivedHandlers`, `HasDataChangedHandlers`

public class FilteredList extends ResultSet
A subclass of `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

  Constructors
  Constructor
  Description
  `FilteredList()`
  `FilteredList(JavaScriptObject jsObj)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `JavaScriptObject`
  `create()`
  `Record[]`
  `getAllRows()`
  Complete set of records for this filteredList.
  `DataSource`
  `getDataSource()`
  Optional dataSource to specifying field names and types for records within this List.
  `boolean`
  `getModifiable()`
  When true, allows the ResultSet to be modified by list APIs `List.addAt()`, `List.set()`, and `List.removeAt()`.
  `static FilteredList`
  `getOrCreateRef(JavaScriptObject jsObj)`
  `void`
  `invalidateCache()`
  Invoking invalidateCache() will have no effect on a filteredList.
  `FilteredList`
  `setAllRows(Record... allRows)`
  Complete set of records for this filteredList.
  `FilteredList`
  `setDataSource(DataSource dataSource)`
  Optional dataSource to specifying field names and types for records within this List.
  `FilteredList`
  `setModifiable(boolean modifiable)`
  When true, allows the ResultSet to be modified by list APIs `List.addAt()`, `List.set()`, and `List.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

    public FilteredList(JavaScriptObject jsObj)

- ## Method Details

  - ### getOrCreateRef

    public static FilteredList getOrCreateRef(JavaScriptObject jsObj)

  - ### create

    public JavaScriptObject create()
    Overrides:
      `create` in class `ResultSet`

  - ### setAllRows

    public FilteredList setAllRows(Record... allRows) throws IllegalStateException
    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: Updates `allRows` at run time.

    Note : This is an advanced setting

    Overrides:
      `setAllRows` in class `ResultSet`
    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

    public Record[] getAllRows()
    Complete set of records for this filteredList. Sorting and filtering of this list will occur synchronously on the client.
    Overrides:
      `getAllRows` in class `ResultSet`
    Returns:
      Current allRows value. Default value is []

  - ### setDataSource

    public FilteredList setDataSource(DataSource dataSource) throws IllegalStateException
    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 via `allRows`, 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 class `ResultSet`
    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:
      - `DataBinding`
      - DataSource fields Example

  - ### getDataSource

    public DataSource 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 via `allRows`, 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 class `ResultSet`
    Returns:
      Current dataSource value. Default value is null
    See Also:
      - `DataBinding`
      - DataSource fields Example

  - ### setModifiable

    public FilteredList setModifiable(boolean modifiable)
    When true, allows the ResultSet to be modified by list APIs `List.addAt()`, `List.set()`, and `List.removeAt()`. Only applies to `fetchMode`:"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 the `ResultSet Overview` for the alternative approach of updating the `DataSource`.

    One known case where modification can be useful is when an array has been passed to `ListGrid.setData()` for a ListGrid with `ListGrid.filterLocalData`:true. If the data is filtered using the `filterEditor`, then a new local ResultSet will be created as `data` to reflect the filtering.

    Overrides:
      `setModifiable` in class `ResultSet`
    Parameters:
      `modifiable` - New modifiable value. Default value is true
    Returns:
      `FilteredList` instance, for chaining setter calls
    See Also:
      - `DataSource.addData(com.smartgwt.client.data.Record)`
      - `DataSource.removeData(com.smartgwt.client.data.Record)`
      - `DataSource.updateCaches(com.smartgwt.client.data.DSResponse)`

  - ### getModifiable

    public boolean getModifiable()
    When true, allows the ResultSet to be modified by list APIs `List.addAt()`, `List.set()`, and `List.removeAt()`. Only applies to `fetchMode`:"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 the `ResultSet Overview` for the alternative approach of updating the `DataSource`.

    One known case where modification can be useful is when an array has been passed to `ListGrid.setData()` for a ListGrid with `ListGrid.filterLocalData`:true. If the data is filtered using the `filterEditor`, then a new local ResultSet will be created as `data` to reflect the filtering.

    Overrides:
      `getModifiable` in class `ResultSet`
    Returns:
      Current modifiable value. Default value is true
    See Also:
      - `DataSource.addData(com.smartgwt.client.data.Record)`
      - `DataSource.removeData(com.smartgwt.client.data.Record)`
      - `DataSource.updateCaches(com.smartgwt.client.data.DSResponse)`

  - ### 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 to `setAllRows()`.
    Overrides:
      `invalidateCache` in class `ResultSet`