Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215

dijit/tree/ForestStoreModel.js

  • Provides:

    • dijit.tree.ForestStoreModel
  • Requires:

    • dijit.tree.TreeStoreModel in common
  • dijit.tree.ForestStoreModel

    • type
      Function
    • chains:
      • dijit.tree.TreeStoreModel: (prototype)
      • dijit.tree.TreeStoreModel: (call)
    • parameters:
      • params
    • summary
      Interface between a dijit.Tree and a dojo.data store that doesn't have a root item,
      a.k.a. a store that has multiple "top level" items.
      
      description
      Use this class to wrap a dojo.data store, making all the items matching the specified query
      appear as children of a fabricated "root item".  If no query is specified then all the
      items returned by fetch() on the underlying store become children of the root item.
      This class allows dijit.Tree to assume a single root item, even if the store doesn't have one.
      
      When using this class the developer must override a number of methods according to their app and
      data, including:
      - onNewRootItem
      - onAddToRoot
      - onLeaveRoot
      - onNewItem
      - onSetItem
    • tags:
    • example
      	{type:'continent'}
  • dijit.tree.ForestStoreModel.rootId

    • type
      String
    • summary
      ID of fabricated root item
  • dijit.tree.ForestStoreModel.rootLabel

    • type
      String
    • summary
      Label of fabricated root item
  • dijit.tree.ForestStoreModel.query

    • type
      String
    • summary
      Specifies the set of children of the root item.
  • dijit.tree.ForestStoreModel.constructor

    • constructor - constructor
    • type
      Function
    • parameters:
      • params
    • summary
      Sets up variables, etc.
    • tags:
  • dijit.tree.ForestStoreModel.mayHaveChildren

    • parameters:
      • item: (typeof dojo.data.Item)
    • summary
      Tells if an item has or may have children.  Implementing logic here
      avoids showing +/- expando icon for nodes that we know don't have children.
      (For efficiency reasons we may not want to check if an element actually
      has children until user clicks the expando node)
    • tags: extension
    • type
      Function
  • dijit.tree.ForestStoreModel.getChildren

    • parameters:
      • parentItem: (typeof dojo.data.Item)
      • callback: (typeof function(items))
      • onError: (typeof function)
    • summary
      Calls onComplete() with array of child items of given parent item, all loaded.
    • type
      Function
  • dijit.tree.ForestStoreModel.isItem

    • parameters:
      • something: (typeof anything)
    • type
      Function
  • dijit.tree.ForestStoreModel.fetchItemByIdentity

    • parameters:
      • keywordArgs: (typeof object)
    • type
      Function
  • dijit.tree.ForestStoreModel.getIdentity

    • parameters:
      • item: (typeof item)
    • type
      Function
  • dijit.tree.ForestStoreModel.getLabel

    • parameters:
      • item: (typeof item)
    • type
      Function
  • dijit.tree.ForestStoreModel.newItem

    • parameters:
      • args: (typeof dojo.dnd.Item)
      • parent: (typeof Item)
      • insertIndex: (typeof int)
    • summary
      Creates a new item.   See dojo.data.api.Write for details on args.
      Used in drag & drop when item from external source dropped onto tree.
    • type
      Function
  • dijit.tree.ForestStoreModel.onNewRootItem

    • parameters:
      • args
    • summary
      User can override this method to modify a new element that's being
      added to the root of the tree, for example to add a flag like root=true
    • type
      Function
  • dijit.tree.ForestStoreModel.pasteItem

    • parameters:
      • childItem: (typeof Item)
      • oldParentItem: (typeof Item)
      • newParentItem: (typeof Item)
      • bCopy: (typeof Boolean)
      • insertIndex: (typeof int)
    • summary
      Move or copy an item from one parent item to another.
      Used in drag & drop
    • type
      Function
  • dijit.tree.ForestStoreModel.onAddToRoot

    • parameters:
      • item: (typeof item)
    • summary
      Called when item added to root of tree; user must override this method
      to modify the item so that it matches the query for top level items
    • example
      	store.setValue(item, "root", true);
    • tags: extension
    • type
      Function
  • dijit.tree.ForestStoreModel.onLeaveRoot

    • parameters:
      • item: (typeof item)
    • summary
      Called when item removed from root of tree; user must override this method
      to modify the item so it doesn't match the query for top level items
    • example
      	store.unsetAttribute(item, "root");
    • tags: extension
    • type
      Function
  • dijit.tree.ForestStoreModel._requeryTop

    • type
      Function
  • dijit.tree.ForestStoreModel.root.children

    • type
      Array
  • dijit.tree.ForestStoreModel.onNewItem

    • parameters:
      • item: (typeof dojo.data.Item)
      • parentInfo: (typeof Object)
    • summary
      Handler for when new items appear in the store.  Developers should override this
      method to be more efficient based on their app/data.
    • description
      Note that the default implementation requeries the top level items every time
      a new item is created, since any new item could be a top level item (even in
      addition to being a child of another item, since items can have multiple parents).
      
      If developers can detect which items are possible top level items (based on the item and the
      parentInfo parameters), they should override this method to only call _requeryTop() for top
      level items.  Often all top level items have parentInfo==null, but
      that will depend on which store you use and what your data is like.
    • tags: extension
    • type
      Function
  • dijit.tree.ForestStoreModel.onDeleteItem

    • parameters:
      • item: (typeof Object)
    • summary
      Handler for delete notifications from underlying store
    • type
      Function
  • dijit.tree.ForestStoreModel.onSetItem

    • parameters:
      • item: (typeof item)
      • attribute: (typeof attribute-name-string)
      • oldValue: (typeof object)
        | array
      • newValue: (typeof object)
        | array
    • summary
      Updates the tree view according to changes to an item in the data store.
      Developers should override this method to be more efficient based on their app/data.
    • description
      Handles updates to an item's children by calling onChildrenChange(), and
      other updates to an item by calling onChange().
      
      Also, any change to any item re-executes the query for the tree's top-level items,
      since this modified item may have started/stopped matching the query for top level items.
      
      If possible, developers should override this function to only call _requeryTop() when
      the change to the item has caused it to stop/start being a top level item in the tree.
    • tags: extension
    • type
      Function
  • dijit.tree.ForestStoreModel.root

    • type
      Object
  • dijit.tree

    • type
      Object
  • dijit

    • type
      Object