dojox/data/ClientFilter (version 1.10)

Usage

var foo = new ClientFilter();
dojox/data/ClientFilter
<

To a update a result set after a notification (onNew, onSet, and onDelete), widgets can call the updateResultSet method. Widgets can use the updated result sets to determine how to react to notifications, and how to update their displayed results based on changes.

This module will use the best available information to update result sets, using query attribute objects to determine if items are in a result set, and using the sort arrays to maintain sort information. However, queries can be opaque strings, and this module can not update results by itself in this case. In this situations, data stores can provide a isUpdateable(request) function and matchesQuery(item,request) function. If a data store can handle a query, it can return true from isUpdateable and if an item matches a query, it can return true from matchesQuery. Here is definition of isUpdateable and matchesQuery:

You can define a property on this object instance "cacheByDefault" to a value of true that will cause all queries to be cached by default unless the cache queryOption is explicitly set to false. This can be defined in the constructor options for ServiceStore/JsonRestStore and subtypes.

>To a update a result set after a notification (onNew, onSet, and onDelete), widgets can call the updateResultSet method. Widgets can use the updated result sets to determine how to react to notifications, and how to update their displayed results based on changes.

This module will use the best available information to update result sets, using query attribute objects to determine if items are in a result set, and using the sort arrays to maintain sort information. However, queries can be opaque strings, and this module can not update results by itself in this case. In this situations, data stores can provide a isUpdateable(request) function and matchesQuery(item,request) function. If a data store can handle a query, it can return true from isUpdateable and if an item matches a query, it can return true from matchesQuery. Here is definition of isUpdateable and matchesQuery:

You can define a property on this object instance "cacheByDefault" to a value of true that will cause all queries to be cached by default unless the cache queryOption is explicitly set to false. This can be defined in the constructor options for ServiceStore/JsonRestStore and subtypes.

>

See the dojox/data/ClientFilter reference documentation for more information.

Property Summary

Method Summary

  • cachingFetch(args)
  • clearCache() Clears the cache of client side queries
  • clientSideFetch(request,baseResults) Performs a query on the client side and returns the results as an array
  • clientSidePaging(request,baseResults)
  • isUpdateable(request) Returns whether the provide fetch arguments can be used to update an existing list
  • makeComparator(sort) returns a comparator function for the given sort order array
  • matchesQuery(item,request)
  • querySuperSet(argsSuper,argsSub) Determines whether the provided arguments are super/sub sets of each other
  • updateResultSet(resultSet,request) Attempts to update the given result set based on previous notifications

Event Summary

Properties

cacheByDefault
serverVersion

Methods

cachingFetch(args)
Parameter Type Description
args undefined
Returns:undefined
clearCache()

Clears the cache of client side queries

clientSideFetch(request,baseResults)

Performs a query on the client side and returns the results as an array

Parameter Type Description
request Object

See dojo/data/api/Read.fetch request

baseResults Array

This provides the result set to start with for client side querying

Returns:undefined
clientSidePaging(request,baseResults)
Parameter Type Description
request Object
baseResults Array
Returns:Array
isUpdateable(request)

Returns whether the provide fetch arguments can be used to update an existing list

Parameter Type Description
request Object

See dojo/data/api/Read.fetch request

Returns:boolean
makeComparator(sort)

returns a comparator function for the given sort order array

Parameter Type Description
sort undefined

See dojox.data.api.Read.fetch

Returns:function
matchesQuery(item,request)
Parameter Type Description
item undefined
request undefined
Returns:boolean
querySuperSet(argsSuper,argsSub)

Determines whether the provided arguments are super/sub sets of each other

Parameter Type Description
argsSuper undefined

Dojo Data Fetch arguments

argsSub undefined

Dojo Data Fetch arguments

Returns:object | boolean
updateResultSet(resultSet,request)

Attempts to update the given result set based on previous notifications

This will attempt to update the provide result based on previous notification, adding new items from onNew calls, removing deleted items, and updating modified items, and properly removing and adding items as required by the query and sort parameters.

Parameter Type Description
resultSet Array

The result set array that should be updated

request Object

This object follows the same meaning as the keywordArgs passed to a dojo/data/api/Read.fetch.

Returns:any | number
  • 0: Indicates it could not successfully update the result set
  • 1: Indicates it could successfully handle all the notifications, but no changes were made to the result set
  • 2: Indicates it successfully handled all the notifications and result set has been updated.

Events

onUpdate()
Error in the documentation? Can’t find what you are looking for? Let us know!