From 81bea17aefb26859f825b9293c7c99192874806e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 8 Nov 2011 20:40:44 +0400 Subject: upgrade Dojo to 1.6.1 --- lib/dijit/tree/TreeStoreModel.js | 510 ++++++++++++++++++++++++++++----------- 1 file changed, 373 insertions(+), 137 deletions(-) (limited to 'lib/dijit/tree/TreeStoreModel.js') diff --git a/lib/dijit/tree/TreeStoreModel.js b/lib/dijit/tree/TreeStoreModel.js index c03bef526..5164176b7 100644 --- a/lib/dijit/tree/TreeStoreModel.js +++ b/lib/dijit/tree/TreeStoreModel.js @@ -1,145 +1,381 @@ /* - Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. + Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ -if(!dojo._hasResource["dijit.tree.TreeStoreModel"]){ -dojo._hasResource["dijit.tree.TreeStoreModel"]=true; +if(!dojo._hasResource["dijit.tree.TreeStoreModel"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. +dojo._hasResource["dijit.tree.TreeStoreModel"] = true; dojo.provide("dijit.tree.TreeStoreModel"); -dojo.declare("dijit.tree.TreeStoreModel",null,{store:null,childrenAttrs:["children"],newItemIdAttr:"id",labelAttr:"",root:null,query:null,deferItemLoadingUntilExpand:false,constructor:function(_1){ -dojo.mixin(this,_1); -this.connects=[]; -var _2=this.store; -if(!_2.getFeatures()["dojo.data.api.Identity"]){ -throw new Error("dijit.Tree: store must support dojo.data.Identity"); -} -if(_2.getFeatures()["dojo.data.api.Notification"]){ -this.connects=this.connects.concat([dojo.connect(_2,"onNew",this,"onNewItem"),dojo.connect(_2,"onDelete",this,"onDeleteItem"),dojo.connect(_2,"onSet",this,"onSetItem")]); -} -},destroy:function(){ -dojo.forEach(this.connects,dojo.disconnect); -},getRoot:function(_3,_4){ -if(this.root){ -_3(this.root); -}else{ -this.store.fetch({query:this.query,onComplete:dojo.hitch(this,function(_5){ -if(_5.length!=1){ -throw new Error(this.declaredClass+": query "+dojo.toJson(this.query)+" returned "+_5.length+" items, but must return exactly one item"); -} -this.root=_5[0]; -_3(this.root); -}),onError:_4}); -} -},mayHaveChildren:function(_6){ -return dojo.some(this.childrenAttrs,function(_7){ -return this.store.hasAttribute(_6,_7); -},this); -},getChildren:function(_8,_9,_a){ -var _b=this.store; -if(!_b.isItemLoaded(_8)){ -var _c=dojo.hitch(this,arguments.callee); -_b.loadItem({item:_8,onItem:function(_d){ -_c(_d,_9,_a); -},onError:_a}); -return; -} -var _e=[]; -for(var i=0;i