X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..ddde20c4d4ac6a8d53de079761155de813845b3c:/docs/output/Ext.data.Store.html diff --git a/docs/output/Ext.data.Store.html b/docs/output/Ext.data.Store.html index 70d96c71..bf05fa4e 100644 --- a/docs/output/Ext.data.Store.html +++ b/docs/output/Ext.data.Store.html @@ -1,4 +1,4 @@ -
Observable
  Store

Class Ext.data.Store

Package:Ext.data
Defined In:Store.js
Class:Store
Subclasses:ArrayStore, DirectStore, GroupingStore, JsonStore, XmlStore
Extends:Observable

The Store class encapsulates a client side cache of Record +

Observable
  Store

Class Ext.data.Store

Package:Ext.data
Defined In:Store.js
Class:Store
Subclasses:ArrayStore, DirectStore, GroupingStore, JsonStore, XmlStore
Extends:Observable

The Store class encapsulates a client side cache of Record objects which provide input data for Components such as the GridPanel, the ComboBox, or the DataView.

Retrieving Data

@@ -218,10 +218,13 @@ for a description of this property. To modify this property see setBasePar...
See the corresponding configuration option for a description of this property. To modify this property see setBaseParam.
Store fields : Ext.util.MixedCollection
A MixedCollection containing the defined Fields -for the Records stored in this Store. Read-only.
Store lastOptions : Object
Contains the last options object used as the parameter to the load method. See load +for the Records stored in this Store. Read-only.
Store hasMultiSort : Boolean +True if this store is currently sorted by more than one field/direction combination.
Store isDestroyed : Boolean +True if the store has been destroyed already. Read only
Store lastOptions : Object
Contains the last options object used as the parameter to the load method. See load for the details of what this may ...
Contains the last options object used as the parameter to the load method. See load for the details of what this may contain. This may be useful for accessing any params which were used -to load the current Record cache.
Store recordType : Function
The Record constructor as supplied to (or created by) the +to load the current Record cache.
Store multiSortInfo : Object +Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields
Store recordType : Function
The Record constructor as supplied to (or created by) the Reader. Read-only. If the Reader was constructed by passing...
The Record constructor as supplied to (or created by) the Reader. Read-only. @@ -357,7 +360,13 @@ should go based on the current sort information.
Commit all Records with outstanding changes. To handle updates for changes, subscribe to the Store's update event, an...
Commit all Records with outstanding changes. To handle updates for changes, subscribe to the Store's update event, and perform updating when the third parameter is -Ext.data.Record.COMMIT.
Parameters:
  • None.
Returns:
  • void
Store destroy() +Ext.data.Record.COMMIT.
Parameters:
  • None.
Returns:
  • void
Store createMultipleFilterFnArray filters ) + : + Function
Given an array of filter functions (each with optional scope), constructs and returns a single function that returns +...
Given an array of filter functions (each with optional scope), constructs and returns a single function that returns +the result of all of the filters ANDed together
Parameters:
  • filters : Array
    The array of filter objects (each object should contain an 'fn' and optional scope)
Returns:
  • Function
    The multiple filter function
Store createSortFunctionString fieldString direction ) + : + Function
Creates and returns a function which sorts an array by the given field and direction
Creates and returns a function which sorts an array by the given field and direction
Parameters:
  • field : String
    The field to create the sorter for
  • direction : String
    The direction to sort by (defaults to "ASC")
Returns:
  • Function
    A function which sorts by the field/direction combination provided
Store destroy() : void
Destroys the store.
Destroys the store.
Parameters:
  • None.
Returns:
  • void
Store eachFunction fn[Object scope] ) : @@ -365,42 +374,62 @@ Ext.data.Record.COMMIT.
Parameters:< Returning false aborts and exits the iteration.
  • scope : Object
    (optional) The scope (this reference) in which the function is executed. Defaults to the current Record in the iteration.
  • Returns:
    • void
    Store enableBubbleString/Array events ) : - void
    Enables events fired by this Observable to bubble up an owner hierarchy by calling -this.getBubbleTarget() if present...

    Enables events fired by this Observable to bubble up an owner hierarchy by calling -this.getBubbleTarget() if present. There is no implementation in the Observable base class.

    -

    This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default -implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to -access the required target more quickly.

    -

    Example:

    Ext.override(Ext.form.Field, {
    -    //  Add functionality to Field's initComponent to enable the change event to bubble
    
    -    initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
    -        this.enableBubble('change');
    -    }),
    -
    -    //  We know that we want Field's events to bubble directly to the FormPanel.
    
    -    getBubbleTarget : function() {
    -        if (!this.formPanel) {
    -            this.formPanel = this.findParentByType('form');
    -        }
    -        return this.formPanel;
    -    }
    -});
    -
    -var myForm = new Ext.formPanel({
    -    title: 'User Details',
    -    items: [{
    -        ...
    -    }],
    -    listeners: {
    -        change: function() {
    -            // Title goes red if form has been modified.
    
    -            myForm.header.setStyle('color', 'red');
    -        }
    -    }
    -});
    Parameters:
    • events : String/Array
      The event name to bubble, or an Array of event names.
    Returns:
    • void
    Observable filterString fieldString/RegExp value[Boolean anyMatch][Boolean caseSensitive] ) - : - void
    Filter the records by a specified property.
    Filter the records by a specified property.
    Parameters:
    • field : String
      A field on your records
    • value : String/RegExp
      Either a string that the field should begin with, or a RegExp to test -against the field.
    • anyMatch : Boolean
      (optional) true to match any part not just the beginning
    • caseSensitive : Boolean
      (optional) true for case sensitive comparison
    Returns:
    • void
    Store filterByFunction fn[Object scope] ) + void
    Enables events fired by this Observable to bubble up an owner hierarchy by calling +this.getBubbleTarget() if present....

    Enables events fired by this Observable to bubble up an owner hierarchy by calling +this.getBubbleTarget() if present. There is no implementation in the Observable base class.

    +

    This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default +implementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to +access the required target more quickly.

    +

    Example:

    Ext.override(Ext.form.Field, {
    +    //  Add functionality to Field's initComponent to enable the change event to bubble
    +    initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {
    +        this.enableBubble('change');
    +    }),
    +
    +    //  We know that we want Field's events to bubble directly to the FormPanel.
    +    getBubbleTarget : function() {
    +        if (!this.formPanel) {
    +            this.formPanel = this.findParentByType('form');
    +        }
    +        return this.formPanel;
    +    }
    +});
    +
    +var myForm = new Ext.formPanel({
    +    title: 'User Details',
    +    items: [{
    +        ...
    +    }],
    +    listeners: {
    +        change: function() {
    +            // Title goes red if form has been modified.
    +            myForm.header.setStyle('color', 'red');
    +        }
    +    }
    +});
    Parameters:
    • events : String/Array
      The event name to bubble, or an Array of event names.
    Returns:
    • void
    Observable filterString|Array fieldString/RegExp value[Boolean anyMatch][Boolean caseSensitive]Boolean exactMatch ) + : + void
    Filter the records by a specified property. Alternatively, pass an array of filter +options to filter by more than one...
    Filter the records by a specified property. Alternatively, pass an array of filter +options to filter by more than one property. +Single filter example: +store.filter('name', 'Ed', true, true); //finds all records containing the substring 'Ed' +Multiple filter example: +store.filter([ +{ +property : 'name', +value : 'Ed', +anyMatch : true, //optional, defaults to true +caseSensitive: true //optional, defaults to true +}, +//filter functions can also be passed +{ +fn : function(record) { +return record.get('age') == 24 +}, +scope: this +} +]);
    Parameters:
    • field : String|Array
      A field on your records, or an array containing multiple filter options
    • value : String/RegExp
      Either a string that the field should begin with, or a RegExp to test +against the field.
    • anyMatch : Boolean
      (optional) true to match any part not just the beginning
    • caseSensitive : Boolean
      (optional) true for case sensitive comparison
    • exactMatch : Boolean
      True to force exact match (^ and $ characters added to the regex). Defaults to false. Ignored if anyMatch is true.
    Returns:
    • void
    Store filterByFunction fn[Object scope] ) : void
    Filter by a function. The specified function will be called for each Record in this Store. If the function returns tr...
    Filter by a function. The specified function will be called for each @@ -515,7 +544,13 @@ that Reader' the existing cache. Note: that Records in a Store are keyed by their id, so added Records with ids which are already present in the Store will replace existing Records. Only Records with -new, unique ids will be added.
    Returns:
    Store onString eventNameFunction handler[Object scope][Object options] ) +new, unique ids will be added.Returns:Store multiSortArray sortersString direction ) + : + void
    Sorts the contents of this store by multiple field/direction sorters. This is called internally by sort +and would not...
    Sorts the contents of this store by multiple field/direction sorters. This is called internally by sort +and would not usually be called manually. +Multi sorting only currently applies to local datasets - multiple sort data is not currently sent to a proxy +if remoteSort is used.
    Parameters:
    • sorters : Array
      Array of sorter objects (field and direction)
    • direction : String
      Overall direction to sort the ordered results by (defaults to "ASC")
    Returns:
    • void
    Store onString eventNameFunction handler[Object scope][Object options] ) : void
    Appends an event handler to this object (shorthand for addListener.)
    Appends an event handler to this object (shorthand for addListener.)
    Parameters:
    • eventName : String
      The type of event to listen for
    • handler : Function
      The method the event invokes
    • scope : Object
      (optional) The scope (this reference) in which the handler function is executed. If omitted, defaults to the object which fired the event.
    • options : Object
      (optional) An object containing handler configuration.
    Returns:
    • void
    Observable purgeListeners() @@ -581,12 +616,34 @@ if there are no items to save or the save was cancelled.
    Set the value for a property name in this store's baseParams. Usage:myStore.setBaseParam('foo', {bar:3});
    Set the value for a property name in this store's baseParams. Usage:

    myStore.setBaseParam('foo', {bar:3});
    Parameters:Returns:
    Store setDefaultSortString fieldName[String dir] ) : - void
    Sets the default sort column and order to be used by the next load operation.
    Sets the default sort column and order to be used by the next load operation.
    Parameters:
    • fieldName : String
      The name of the field to sort by.
    • dir : String
      (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC')
    Returns:
    • void
    Store sortString fieldName[String dir] ) + void
    Sets the default sort column and order to be used by the next load operation.
    Sets the default sort column and order to be used by the next load operation.
    Parameters:
    • fieldName : String
      The name of the field to sort by.
    • dir : String
      (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC')
    Returns:
    • void
    Store singleSortString fieldName[String dir] ) + : + void
    Sorts the store contents by a single field and direction. This is called internally by sort and would +not usually be ...
    Sorts the store contents by a single field and direction. This is called internally by sort and would +not usually be called manually
    Parameters:
    • fieldName : String
      The name of the field to sort by.
    • dir : String
      (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC')
    Returns:
    • void
    Store sortString/Array fieldName[String dir] ) : void
    Sort the Records. If remote sorting is used, the sort is performed on the server, and the cache is reloaded. If local...
    Sort the Records. If remote sorting is used, the sort is performed on the server, and the cache is reloaded. If local -sorting is used, the cache is sorted internally. See also remoteSort and paramNames.
    Parameters:
    • fieldName : String
      The name of the field to sort by.
    • dir : String
      (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC')
    Returns:
    • void
    Store sumString property[Number start][Number end] ) +sorting is used, the cache is sorted internally. See also remoteSort and paramNames. +This function accepts two call signatures - pass in a field name as the first argument to sort on a single +field, or pass in an array of sort configuration objects to sort by multiple fields. +Single sort example: +store.sort('name', 'ASC'); +Multi sort example: +store.sort([ +{ +field : 'name', +direction: 'ASC' +}, +{ +field : 'salary', +direction: 'DESC' +} +], 'ASC'); +In this second form, the sort configs are applied in order, with later sorters sorting within earlier sorters' results. +For example, if two records with the same name are present they will also be sorted by salary if given the sort configs +above. Any number of sort configs can be added.
    Parameters:Returns:
    Store sumString property[Number start][Number end] ) : Number
    Sums the value of property for each record between start and end and returns the result.
    Sums the value of property for each record between start @@ -605,8 +662,8 @@ false the load action will b...
    Fires before a request is ( Ext.data.Store storeObject data )
    Fires before a save action is called. A save encompasses destroying records, updating records and creating records.
    Fires before a save action is called. A save encompasses destroying records, updating records and creating records.
    Listeners will be called with the following arguments:
    • store : Ext.data.Store
    • data : Object
      An object containing the data that is to be saved. The object will contain a key for each appropriate action, with an array of records for each action.
    Store beforewrite : - ( Ext.data.Store storeString actionRecord/Array[Record] rsObject optionsObject arg ) -
    Listeners will be called with the following arguments:
    • store : Ext.data.Store
    • action : String
      [Ext.data.Api.actions.create|update|destroy]
    • rs : Record/Array[Record]
    • options : Object
      The loading options that were specified. Edit options.params to add Http parameters to the request. (see save for details)
    • arg : Object
      The callback's arg object passed to the request function
    Store clear : + ( Ext.data.Store storeString actionRecord/Record[] rsObject optionsObject arg ) +
    Listeners will be called with the following arguments:
    • store : Ext.data.Store
    • action : String
      [Ext.data.Api.actions.create|update|destroy]
    • rs : Record/Record[]
      The Record(s) being written.
    • options : Object
      The loading options that were specified. Edit options.params to add Http parameters to the request. (see save for details)
    • arg : Object
      The callback's arg object passed to the request function
    Store clear : ( Store thisRecord[] The )
    Fires when the data cache has been cleared.
    Fires when the data cache has been cleared.
    Listeners will be called with the following arguments:
    • this : Store
    • The : Record[]
      records that were cleared.
    Store datachanged : ( Store this )