dojox/grid/LazyTreeGridStoreModel.js

  • Provides:

    • dojox.grid.LazyTreeGridStoreModel
  • Requires:

    • dijit.tree.ForestStoreModel in common in project dijit
  • dojox.grid.LazyTreeGridStoreModel

    • type
      Function
    • chains:
      • dijit.tree.ForestStoreModel: (prototype)
      • dijit.tree.ForestStoreModel: (call)
    • parameters:
      • args: (typeof Object)
    • source: [view]
        this.serverStore = args.serverStore === true ? true : false;
    • summary
  • dojox.grid.LazyTreeGridStoreModel.serverStore

    • summary
  • dojox.grid.LazyTreeGridStoreModel.mayHaveChildren

    • type
      Function
    • parameters:
      • item: (typeof dojo.data.Item)
    • source: [view]
        var children = null;
        return dojo.some(this.childrenAttrs, function(attr){
          children = this.store.getValue(item, attr);
          if(dojo.isString(children)){
           return parseInt(children, 10) > 0 || children.toLowerCase() === "true" ? true : false;
          }else if(typeof children == "number"){
           return children > 0;
          }else if(typeof children == "boolean"){
           return children;
          }else if(this.store.isItem(children)){
           children = this.store.getValues(item, attr);
           return dojo.isArray(children) ? children.length > 0 : false;
          }else{
           return false;
          }
        }, this);
    • summary
  • dojox.grid.LazyTreeGridStoreModel.getChildren

    • type
      Function
    • parameters:
      • parentItem: (typeof dojo.data.Item)
      • onComplete: (typeof function(items, size))
      • onError: (typeof function)
      • queryObj: (typeof object)
    • source: [view]
        if(queryObj){
         var start = queryObj.start || 0,
          count = queryObj.count,
          parentId = queryObj.parentId,
          sort = queryObj.sort;
         if(parentItem === this.root){
          this.root.size = 0;
          this.store.fetch({
           start: start,
           count: count,
           sort: sort,
           query: this.query,
           onBegin: dojo.hitch(this, function(size){
            this.root.size = size;
           }),
           onComplete: dojo.hitch(this, function(items){
            onComplete(items, queryObj, this.root.size);
           }),
           onError: onError
          });
         }else{
          var store = this.store;
          if(!store.isItemLoaded(parentItem)){
           var getChildren = dojo.hitch(this, arguments.callee);
           store.loadItem({
            item: parentItem,
            onItem: function(parentItem){
             getChildren(parentItem, onComplete, onError, queryObj);
            },
            onError: onError
           });
           return;
          }
          if(this.serverStore && !this._isChildrenLoaded(parentItem)){
           this.childrenSize = 0;
           this.store.fetch({
            start: start,
            count: count,
            sort: sort,
            query: dojo.mixin({parentId: parentId}, this.query || {}),
            onBegin: dojo.hitch(this, function(size){
             this.childrenSize = size;
            }),
            onComplete: dojo.hitch(this, function(items){
             onComplete(items, queryObj, this.childrenSize);
            }),
            onError: onError
           });
          }else{
           this.inherited(arguments);
          }
         }
        }else{
         this.inherited(arguments);
        }
    • summary
  • dojox.grid.LazyTreeGridStoreModel._isChildrenLoaded

    • type
      Function
    • parameters:
      • parentItem: (typeof )
    • source: [view]
        var children = null;
        return dojo.every(this.childrenAttrs, function(attr){
         children = this.store.getValues(parentItem, attr);
         return dojo.every(children, function(c){
          return this.store.isItemLoaded(c);
         }, this);
        }, this);
    • summary
      Check if all children of the given item have been loaded
  • dojox.grid.LazyTreeGridStoreModel.root.size

    • summary
  • dojox.grid.LazyTreeGridStoreModel.childrenSize

    • summary
  • dojox.grid

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary