Login Register Help
API Documentation
Choose a stylesheet:

Constructordojox.data.QueryReadStore

dojo.require("dojox.data.QueryReadStore");
By default all the sorting is done serverside before the data is returned which is the proper place to be doing it for really large datasets.

Usage

var foo=new dojox.data.QueryReadStore(params: Object);
parametertypedescription
paramsObject 

Examples

Example 1

// The parameter "query" contains the data that are sent to the server.
var store = new dojox.data.QueryReadStore({url:'/search.php'});
store.fetch({query:{name:'a'}, queryOptions:{ignoreCase:false}});
 
 
// Since "serverQuery" is given, it overrules and those data are
// sent to the server.
var store = new dojox.data.QueryReadStore({url:'/search.php'});
store.fetch({serverQuery:{name:'a'}, queryOptions:{ignoreCase:false}});
 
 
<div dojoType="dojox.data.QueryReadStore"
    jsId="store2"
    url="../tests/stores/QueryReadStore.php"
    requestMethod="post"></div>
<div dojoType="dojox.grid.data.DojoData"
    jsId="model2"
    store="store2"
    sortFields="[{attribute: 'name', descending: true}]"
    rowsPerPage="30"></div>
<div dojoType="dojox.Grid" id="grid2"
    model="model2"
    structure="gridLayout"
    style="height:300px; width:800px;"></div>

Jump to PropertiesFunctionsBack to top

FunctioncontainsValue(item: item, attribute: attribute-name-string, value: anything)
Functionfetch(request: Object?): Object
See dojo.data.util.simpleFetch.fetch() this is just a copy and I adjusted only the paging, since it happens on the server if doClientPaging is false, thx to http://trac.dojotoolkit.org/ticket/4761 reporting this. Would be nice to be able to use simpleFetch() to reduce copied code, but i dont know how yet. Ideas please!
See dojo.data.api.Identity.fetchItemByIdentity()
FunctiongetAttributes(item: item)
FunctiongetIdentity(item: item)
See dojo.data.api.Identity.getIdentity()
See dojo.data.api.Identity.getIdentityAttributes()
FunctiongetLabel(item: item): String | undefined
See dojo.data.api.Read.getLabel()
FunctiongetLabelAttributes(item: item): Array | null
See dojo.data.api.Read.getLabelAttributes()
FunctiongetValue(item: item, attribute: attribute-name-string, defaultValue: value?)
FunctiongetValues(item: item, attribute: attribute-name-string)
FunctionhasAttribute(item: item, attribute: attribute-name-string)
See dojo.data.api.Read.hasAttribute()
FunctionisItem(something: anything)
FunctionisItemLoaded(something: anything)
Function_assertIsAttribute(attribute: attribute-name-string)
This function tests whether the item passed in is indeed a valid 'attribute' like type for the store.
Function_assertIsItem(item: item)
It throws an error if item is not valid, so you can call it in every method that needs to throw an error when item is invalid.
Function_fetchItems(request, fetchHandler, errorHandler)
The request contains the data as defined in the Read-API. Additionally there is following keyword "serverQuery". The *serverQuery* parameter, optional. This parameter contains the data that will be sent to the server. If this parameter is not given the parameter "query"'s data are sent to the server. This is done for some reasons: - to specify explicitly which data are sent to the server, they might also be a mix of what is contained in "query", "queryOptions" and the paging parameters "start" and "count" or may be even completely different things. - don't modify the request.query data, so the interface using this store can rely on unmodified data, as the combobox dijit currently does it, it compares if the query has changed - request.query is required by the Read-API I.e. the following examples might be sent via GET: fetch({query:{name:"abc"}, queryOptions:{ignoreCase:true}}) the URL will become: /url.php?name=abc fetch({serverQuery:{q:"abc", c:true}, query:{name:"abc"}, queryOptions:{ignoreCase:true}}) the URL will become: /url.php?q=abc&c=true // The serverQuery-parameter has overruled the query-parameter // but the query parameter stays untouched, but is not sent to the server! // The serverQuery contains more data than the query, so they might differ!
Function_filterResponse(data: The)
If the data from servers needs to be processed before it can be processed by this store, then this function should be re-implemented in subclass. This default implementation just return the data unchanged.
Function_xhrFetchHandler(data, request, fetchHandler, errorHandler)

Jump to FunctionsPropertiesBack to top