Clear Up
SharpKit Reference

TreeStore Class

Namespace: Ext.data

Base Types

System.Object

Constructors

Name Description
TreeStore()
TreeStore(TreeStoreConfig)
TreeStore(object) @cfg {Boolean} folderSort Set to true to automatically prepend a leaf sorter. Defaults to `undefined`.

Properties

Name Description
alias The TreeStore is a store implementation that is backed by by an {@link Ext.data.Tree}. It provides convenience methods for loading nodes, as well as the ability to use the hierarchical tree structure combined with a store. This class also relays many events from the Tree for convenience. * # Using Models * If no Model is specified, an implicit model will be created that implements {@link Ext.data.NodeInterface}. The standard Tree fields will also be copied onto the Model for maintaining their state. These fields are listed in the {@link Ext.data.NodeInterface} documentation. * # Reading Nested Data * For the tree to read nested data, the {@link Ext.data.reader.Reader} must be configured with a root property, so the reader can find nested data for each node. If a root is not specified, it will default to 'children'.
clearOnLoad @cfg {Boolean} clearOnLoad Remove previously existing child nodes before loading. Default to true.
defaultRootId @cfg {String} defaultRootId The default root id. Defaults to 'root'
defaultRootProperty @cfg {String} defaultRootProperty The root property to specify on the reader if one is not explicitly defined.
extend The TreeStore is a store implementation that is backed by by an {@link Ext.data.Tree}. It provides convenience methods for loading nodes, as well as the ability to use the hierarchical tree structure combined with a store. This class also relays many events from the Tree for convenience. * # Using Models * If no Model is specified, an implicit model will be created that implements {@link Ext.data.NodeInterface}. The standard Tree fields will also be copied onto the Model for maintaining their state. These fields are listed in the {@link Ext.data.NodeInterface} documentation. * # Reading Nested Data * For the tree to read nested data, the {@link Ext.data.reader.Reader} must be configured with a root property, so the reader can find nested data for each node. If a root is not specified, it will default to 'children'.
folderSort @cfg {Boolean} folderSort Set to true to automatically prepend a leaf sorter. Defaults to `undefined`.
nodeParam @cfg {String} nodeParam The name of the parameter sent to the server which contains the identifier of the node. Defaults to 'node'.
Proxy
RootNode Sets the root node for this store. See also the {@link #root} config option. @param {Ext.data.Model/Ext.data.NodeInterface/Object} root @return {Ext.data.NodeInterface} The new root

Methods

Name Description
doSort(object)
fillNode(NodeInterface, object) Fills a node with a series of child records. @private @param {Ext.data.NodeInterface} node The node to fill @param {Ext.data.Model[]} records The records to add
getNewRecords()
getNodeById(object) Returns the record node by id @return {Ext.data.NodeInterface}
getRootNode() Returns the root node for this tree. @return {Ext.data.NodeInterface}
getUpdatedRecords()
load(object) Loads the Store using its configured {@link #proxy}. @param {Object} options (Optional) config object. This is passed into the {@link Ext.data.Operation Operation} object that is created and then sent to the proxy's {@link Ext.data.proxy.Proxy#read} function. The options can also contain a node, which indicates which node is to be loaded. If not specified, it will default to the root node.
onBeforeNodeCollapse(NodeInterface, JsAction, object) Called before a node is collapsed. @private @param {Ext.data.NodeInterface} node The node being collapsed. @param {Function} callback The function to run after the collapse finishes @param {Object} scope The scope in which to run the callback function
onBeforeNodeExpand(NodeInterface, JsAction, object) Called before a node is expanded. @private @param {Ext.data.NodeInterface} node The node being expanded. @param {Function} callback The function to run after the expand finishes @param {Object} scope The scope in which to run the callback function
onBeforeSort()
onCreateRecords(object, Operation, bool) Creates any new records when a write is returned from the server. @private @param {Ext.data.Model[]} records The array of new records @param {Ext.data.Operation} operation The operation that just completed @param {Boolean} success True if the operation was successful
onDestroyRecords(object, Operation, bool) Removes any records when a write is returned from the server. @private @param {Ext.data.Model[]} records The array of removed records @param {Ext.data.Operation} operation The operation that just completed @param {Boolean} success True if the operation was successful
onNodeAdded(object, object)
onNodeRemove(object, object)
onProxyLoad(object)
onUpdateRecords(object, Operation, bool) Updates any records when a write is returned from the server. @private @param {Ext.data.Model[]} records The array of updated records @param {Ext.data.Operation} operation The operation that just completed @param {Boolean} success True if the operation was successful
removeAll()
setProxy(object)
setRootNode(object) Sets the root node for this store. See also the {@link #root} config option. @param {Ext.data.Model/Ext.data.NodeInterface/Object} root @return {Ext.data.NodeInterface} The new root
© Copyright 2005-2011 SharpKit. All rights reserved.